我是nodejs的新手,npm并且无法弄清楚为什么我会收到此错误。任何猜测? I've tried this, but it didn't work
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
答案 0 :(得分:1)
npm
尝试使用https
来获取tar。这是旧的配置:
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/