关于 -bash: npm: command not found

一、npm: command not found

  节后余生,开工发现运行 npm run dev失败

  然后运行其他命令显示:

  

Error: You have not agreed to the Xcode license. Please resolve this by running:

  sudo xcodebuild -license

-bash: /nvm.sh: No such file or directory

 

  怀疑是xcode的问题,

  首先按照提示:sudo xcodebuild -license

  然后会显示xcode的参考同意证书,直接q,然后agree同意;

  再次运行npm 还是显示command not found

    由于之前 node是正常的,所以只是在 使~/.bash_profile生效即可: source ~/.bash_profile

二、其他原因,可能是$PATH配置问题

  参照:node.js控制和nvm失效问题

 

 

  

posted @ 2017-10-09 09:57  半天的半天  阅读(47578)  评论(0编辑  收藏  举报