我更新了,或者尝试使用" sudo npm update -g"现在我不能用npm做任何事情。我收到以下错误:
/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/adduser.js:75
if (!error || !response || response.statusCode !== 409) {
^^
SyntaxError: Unexpected token if
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at /usr/local/lib/node_modules/npm/node_modules/npm-registry-client/index.js:54:49
at Array.forEach (native)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/index.js:52:47)
at Module._compile (module.js:456:26)
答案 0 :(得分:0)
这是通过从brew卸载节点并重新安装来解决的。