Home > Net >  An unhandled exception occurred: Cannot find module './browsers' -
An unhandled exception occurred: Cannot find module './browsers' -

Time:02-26

I looked for other questions available on stack but was not able to find ans related to this issue.

I have just started Angular and installed things as asked on Udemy course. Creating app and then starting with ng serve.

While I am running ng serve, I am getting below error.

enter image description here

After running npm install I am getting below message. enter image description here Can you please guide me to solve this error ?

Thank you very much in advance. :)

CodePudding user response:

well try this one it works for me: npm install --save-dev @angular-devkit/build-angular

CodePudding user response:

If the error message persists after installing packages, it may be due to the NPM settings. In recent versions of the package manager, by default it only installs the packages needed for the production version of the project. The "build-angular" package is a development dependency. If you want to make the website work, you have to tell NPM to install the development packages, by adding the "--only" option with the "dev" version so you should use this command instead:
npm i --only=dev

  • Related