Error: failed to fetch from registry: forever , https://registry.npmjs.org/forever

Error: failed to fetch from registry: forever , https://registry.npmjs.org/forever

我刚刚安装了 node 和 npm,但是当我尝试安装 forever sudo npm install forever -g 或 sudo npm install -g forever 时,错误日志文件中报告了这个错误。

verbose cli [ 'node', '/usr/local/bin/npm', 'install', 'forever', '-g' ]
info using npm@1.1.0-2
info using node@v0.6.8
verbose config file /root/.npmrc
verbose config file /usr/local/etc/npmrc
verbose config file /usr/local/lib/node_modules/npm/npmrc
silly exec /usr/local/bin/node "/usr/local/lib/node_modules/npm/bin/npm-get-uid-gid.js" "nobody" 0
silly spawning [ '/usr/local/bin/node',
silly spawning   [ '/usr/local/lib/node_modules/npm/bin/npm-get-uid-gid.js',
silly spawning     'nobody',
silly spawning     0 ],
silly spawning   null ]
silly output from getuid/gid {"uid":99,"gid":0}
silly output from getuid/gid
verbose cache add [ 'forever', null ]
silly cache add: name, spec, args [ undefined, 'forever', [ 'forever', null ] ]
verbose parsed url { pathname: 'forever', path: 'forever', href: 'forever' }
verbose addNamed [ 'forever', '' ]
verbose addNamed [ null, '' ]
silly name, range, hasData [ 'forever', '', false ]
verbose raw, before any munging forever
verbose url resolving [ 'https://registry.npmjs.org/', './forever' ]
verbose url resolved https://registry.npmjs.org/forever
http GET https://registry.npmjs.org/forever
ERR! Error: failed to fetch from registry: forever
ERR!     at /usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/get.js:139:12
ERR!     at cb (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:32:9)
ERR!     at Request._callback (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:137:18)
ERR!     at Request.callback (/usr/local/lib/node_modules/npm/node_modules/request/main.js:109:22)
ERR!     at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/main.js:198:58)
ERR!     at Request.emit (events.js:88:20)
ERR!     at ClientRequest.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/main.js:356:14)
ERR!     at ClientRequest.emit (events.js:67:17)
ERR!     at HTTPParser.onIncoming (http.js:1238:11)
ERR!     at HTTPParser.onHeadersComplete (http.js:102:31)
ERR! You may report this log at:
ERR!     <http://github.com/isaacs/npm/issues>

Node 的当前版本是 6.6(截至撰写本文时)。您的日志显示您使用的是 0.6.8 版。尝试安装更新版本的 Node。