1

I receive the following error in the middle of running npm install on the package.json file of an Angular 10 application:

'npm' is not recognized as an internal or external command, operable program or batch file.

I know that npm is installed because I started the install with the command npm install. So, I don't understand why the installation of NPM packages for the Angular application fails partway through with this message.

2 Answers 2

1

I'm not sure exactly what the issue is here, but you have three options which have a chance of working.

  • using npx npm install instead of npm install
  • reinstalling npm via npm i -g npm (this automatically picks the newest version)
  • reinstalling node (I put this one last because it's not worth it for slow internet connections and it's also a waste of time in general considering the above two should work fine)
Sign up to request clarification or add additional context in comments.

Comments

0

The exact reason why this was happening is not certain, but it seems to have started when I updated the package jasmine-core from ~3.5.0 to ~3.10.0.

After I uninstalled Node.js and deleted all folders from previous Node.js installations and after I updated jasmine-core from ~3.5.0 to ~3.8.0 (instead of ~3.10.0), then I was able to run npm install again without errors.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.