npm update 失败,求解决方法

李惟
  • 2.1k

执行命令

npm -g update

提示

npm ERR! Object.keys called on non-object
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <http://github.com/npm/npm/issues>
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "-g" "update"
npm ERR! node v0.10.34
npm ERR! npm  v2.1.14

npm ERR! Object.keys called on non-object
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <http://github.com/npm/npm/issues>
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "-g" "update"
npm ERR! node v0.10.34
npm ERR! npm  v2.1.14

npm ERR! Object.keys called on non-object
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Library/WebServer/Documents/wordpress/npm-debug.log

好像不是网络问题,VPN也不好使,请问怎么解决?

回复
阅读 14.8k
5 个回答

我刚开始使用 npm i -g npm 更新时,出错了,后来发现在 mac 上,必须要用 sudo npm i -g npm 才可以

会不会已经是最新的了。
我这边npm -g update第一遍OK,第二遍出现跟你一样的错误。

a909197213
  • 1
新手上路,请多包涵

npm install -g npm

宣传栏