我最近更改了npm配置,但现在我尝试安装各种程序包时都会持续收到相同的错误信息。由于我认为是个人设置错误造成的,现在我无法使用npm。
我卸载了node和npm并重新安装了,尝试了npm博客中的配置设置,但仍然遇到了相同的错误。也许这与Cellar目录中的权限有关?我认为我之前已经处理好了...
对我来说还不清楚问题所在,非常感谢您的帮助。
以下是错误输出:
npm ERR! registry error parsing json npm ERR! SyntaxError: Unexpected token C npm ERR! Cannot GET http://registry.npmjs.org/node-simple-router npm ERR! at Object.parse (native) npm ERR! at RegClient. (/usr/local/Cellar/node/0.10.26/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:203:23) npm ERR! at Request.self.callback (/usr/local/Cellar/node/0.10.26/lib/node_modules/npm/node_modules/request/request.js:123:22) npm ERR! at Request.EventEmitter.emit (events.js:98:17) npm ERR! at Request. (/usr/local/Cellar/node/0.10.26/lib/node_modules/npm/node_modules/request/request.js:893:14) npm ERR! at Request.EventEmitter.emit (events.js:117:20) npm ERR! at IncomingMessage. (/usr/local/Cellar/node/0.10.26/lib/node_modules/npm/node_modules/request/request.js:844:12) npm ERR! at IncomingMessage.EventEmitter.emit (events.js:117:20) npm ERR! at _stream_readable.js:920:16 npm ERR! at process._tickCallback (node.js:415:13) npm ERR! 如果您需要帮助,可以将此*整个*日志,包括npm和node版本,报告给:
输入
; userconfig /Users/rfatahi/.npmrc ca = "" https-proxy = "http://127.0.0.1:8888/" proxy = "http://127.0.0.1:8888/" registry = "http://registry.npmjs.org/" strict-ssl = true ; builtin config undefined prefix = "/usr/local"
; node bin location = /usr/local/Cellar/node/0.10.26/bin/node
我卸载了node和npm并重新安装了,尝试了npm博客中的配置设置,但仍然遇到了相同的错误。也许这与Cellar目录中的权限有关?我认为我之前已经处理好了...
对我来说还不清楚问题所在,非常感谢您的帮助。
以下是错误输出:
npm ERR! registry error parsing json npm ERR! SyntaxError: Unexpected token C npm ERR! Cannot GET http://registry.npmjs.org/node-simple-router npm ERR! at Object.parse (native) npm ERR! at RegClient. (/usr/local/Cellar/node/0.10.26/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:203:23) npm ERR! at Request.self.callback (/usr/local/Cellar/node/0.10.26/lib/node_modules/npm/node_modules/request/request.js:123:22) npm ERR! at Request.EventEmitter.emit (events.js:98:17) npm ERR! at Request. (/usr/local/Cellar/node/0.10.26/lib/node_modules/npm/node_modules/request/request.js:893:14) npm ERR! at Request.EventEmitter.emit (events.js:117:20) npm ERR! at IncomingMessage. (/usr/local/Cellar/node/0.10.26/lib/node_modules/npm/node_modules/request/request.js:844:12) npm ERR! at IncomingMessage.EventEmitter.emit (events.js:117:20) npm ERR! at _stream_readable.js:920:16 npm ERR! at process._tickCallback (node.js:415:13) npm ERR! 如果您需要帮助,可以将此*整个*日志,包括npm和node版本,报告给:
输入
npm config list
的输出为:
$ npm config list
; cli configs
registry = "http://registry.npmjs.org/"; userconfig /Users/rfatahi/.npmrc ca = "" https-proxy = "http://127.0.0.1:8888/" proxy = "http://127.0.0.1:8888/" registry = "http://registry.npmjs.org/" strict-ssl = true ; builtin config undefined prefix = "/usr/local"
; node bin location = /usr/local/Cellar/node/0.10.26/bin/node
Cannot GET http://registry.npmjs.org/http
م€‚ه¦‚وœè؟™ن¸چوک¯وœ‰و„ڈن¸؛ن¹‹ï¼Œن½ هڈ¯ن»¥è؟گè،Œnpm config set proxy null
و¥ه…³é—ه®ƒم€‚ - alex