Nodejs模块安装错误:请求path包含非转义字符

我是新的nodejs,NPM,不知道为什么我得到这个错误。 任何猜测? 我试过这个,但是没有奏效

npm install -g mongoose 

 1220 http GET https://github.com/mongodb-js/node-pre-gyp/archive/v0.6.5-appveyor.tar.gz 1221 error TypeError: Request path contains unescaped characters. 1221 error at new ClientRequest (_http_client.js:73:11) 1221 error at Object.exports.request (http.js:49:10) 1221 error at TunnelingAgent.exports.request (https.js:136:15) 1221 error at TunnelingAgent.createSocket (C:\software\nodejs\node_modules\npm\node_modules\request\node_modules\tunnel-agent\index.js:117:25) 1221 error at TunnelingAgent.createSecureSocket [as createSocket] (C:\software\nodejs\node_modules\npm\node_modules\request\node_modules\tunnel-agent\index.js:184:41) 1221 error at TunnelingAgent.addRequest (C:\software\nodejs\node_modules\npm\node_modules\request\node_modules\tunnel-agent\index.js:80:8) 1221 error at new ClientRequest (_http_client.js:154:16) 1221 error at Object.exports.request (http.js:49:10) 1221 error at Object.exports.request (https.js:136:15) 1221 error at Request.start (C:\software\nodejs\node_modules\npm\node_modules\request\request.js:583:30 

npm尝试使用https获取tar,因为'.npmrc'文件中的模糊configuration。 这是旧的configuration:

 prefix = C:\software\nodejs strict-ssl = false http-proxy = http://[username]:[password]@[domain]:8080/ https-proxy = https://[username]:[password]@[domain]:8080/ registry = http://registry.npmjs.org/ 

改变它可以解决问题:

 prefix = C:\software\nodejs http-proxy = http://[username]:[password]@[domain]:8080/ #angularjs2 require proxy as key, http-proxy gave the above error proxy = http://[username]:[password]@[domain]:8080/ registry = http://registry.npmjs.org/