简体   繁体   中英

npm 'command not found' no matter what I try

On MacOS:

I'm unable to execute any npm package command. Every time I try, I see command not found. Like so:

-bash: live-server: command not found

I've installed node.js directly from the website. https://nodejs.org/en/download/

I've installed live-server globally, and locally. It appears to work. When I try the command, it fails.

I've removed node.js and npm, re-installed and still fail to execute a command. I'm quite stumped. I've reviewed similar posts, implemented the suggested solutions and still can't manage to execute any npm command. Several of the posts I've reviewed: sudo: npm: command not found

NPM Command Not Found After Installing Node

What should I do next?

Are you using Windows? Did you check if NPM is in Path on "Environments variable"

My bash_profile file had the wrong data saved. Correcting the file solved the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM