简体   繁体   English

无法在Mac上使用更新npm或安装任何npm模块

[英]Unable to use update npm or install any npm module on mac

npm ERR! Darwin 17.2.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "-g" "npm"
npm ERR! node v6.9.2
npm ERR! npm  v3.10.9
npm ERR! code MODULE_NOT_FOUND

npm ERR! Cannot find module 'realize-package-specifier'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

When I try to update npm this the error I receive. 当我尝试更新npm时,我收到错误。 I get similar errors while performing any npm install/update operation. 在执行任何npm安装/更新操作时,我也会收到类似的错误。

Any idea how to resolve this issue? 任何想法如何解决这个问题?

Reinstall node via brew ( brew uninstall node & brew install node ). 通过brew重新安装节点( brew uninstall nodebrew install node )。 npm ships with Node so you should be good to go. npm随Node一起提供,因此您应该一切顺利。 These errors might occur after updating npm, AFAIK this is the safest workaround. 更新npm后,可能会发生这些错误,这是最安全的解决方法。

I installed node using nvm and my issue was resolved. 我使用nvm安装了node ,问题已解决。 This is what I followed to do so. 就是我遵循的步骤。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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