What could cause an error related to npm not being able to find a file? No contents in my node_modules subfolder. Why is that?

The following steps work for me:

  1. npm cache clean -f
  2. rm -rf node_modules
  3. npm i

It might be related to corruption in Angular Packages or incompatibility of packages.

Please follow the below steps to solve the issue.

  • Delete node_modules folder manually.
  • Install Node ( https://nodejs.org/en/download ).
  • Install Yarn ( https://yarnpkg.com/en/docs/install ).
  • Open command prompt , go to path angular folder and run Yarn.
  • Run angular\nswag\refresh.bat.
  • Run npm start from the angular folder.

Update

ASP.NET Boilerplate suggests here to use yarn because npm has some problems. It is slow and can not consistently resolve dependencies, yarn solves those problems and it is compatible to npm as well.


I had the SAME issue today and it was driving me nuts!!! What I had done was upgrade to node 8.10 and upgrade my NPM to the latest I uninstalled angular CLI

npm uninstall -g angular-cli
npm uninstall --save-dev angular-cli

I then verified my Cache from NPM if it wasn't up to date I cleaned it and ran the install again if npm version is < 5 then use npm cache clean --force

npm install -g @angular/cli@latest

and created a new project file and create a new angular project.