Reputation: 1622
I'm new to nodejs, npm and can't figure out why I'm getting this error. Any guesses ? 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
Upvotes: 1
Views: 4716
Reputation: 1622
npm
trying to use https
to get the tar because of ambiguous configuration in '.npmrc' file. Here's the old config:
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/
Changing it to this resolve the issue:
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/
Upvotes: 1