isaacs/npm — Issue #1880: Invalid protocol
Author: tristanjuricek
Created: 2011-12-14 01:05:58+00:00
State: open

Hi, I didn't quite see the same line number setting for this, so I figured I'd add it.

I just tried upgrading to node 0.6.5 from 0.5.4, and get an "Invalid protocol" error whenever I attempt to use npm.

dhcp-11-n100:~ tjuricek$ npm install -g less

And here's the log

info it worked if it ends with ok
verbose cli [ 'node',
verbose cli '/Users/tjuricek/Applications/node/bin/npm',
verbose cli 'install',
verbose cli '-g',
verbose cli 'less' ]
info using npm@1.1.0-alpha-6
info using node@v0.6.5
verbose /Users/tjuricek/Applications/node/bin/node node symlink
verbose config file /Users/tjuricek/.npmrc
verbose config file /Users/tjuricek/Applications/node/etc/npmrc
verbose config file /Users/tjuricek/Applications/node-0.6.5/lib/node_modules/npm/npmrc
verbose into /Users/tjuricek/Applications/node/lib [ 'less' ]
verbose cache add less
verbose cache add [ 'less', null ]
silly cache add: name, spec, args [ undefined, 'less', [ 'less', null ] ]
verbose parsed url { pathname: 'less', path: 'less', href: 'less' }
info addNamed [ 'less', '' ]
verbose addNamed [ null, '' ]
verbose GET less
verbose raw, before any munging less
verbose url resolving [ 'http://registry.npmjs.org/', './less' ]
verbose url resolved http://registry.npmjs.org/less
verbose etag "7GPU7YH11U311580C41C7A0I"
ERR! Error: Invalid protocol
ERR! at Request.request (/Users/tjuricek/Applications/node-0.6.5/lib/node_modules/npm/node_modules/request/main.js:300:31)
ERR! at request (/Users/tjuricek/Applications/node-0.6.5/lib/node_modules/npm/node_modules/request/main.js:552:5)
ERR! at makeRequest (/Users/tjuricek/Applications/node-0.6.5/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:122:13)
ERR! at regRequest (/Users/tjuricek/Applications/node-0.6.5/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:84:3)
ERR! at GET (/Users/tjuricek/Applications/node-0.6.5/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:213:3)
ERR! at get_ (/Users/tjuricek/Applications/node-0.6.5/lib/node_modules/npm/lib/utils/npm-registry-client/get.js:121:3)
ERR! at /Users/tjuricek/Applications/node-0.6.5/lib/node_modules/npm/lib/utils/npm-registry-client/get.js:44:7
ERR! at [object Object]. (fs.js:115:5)
ERR! at [object Object].emit (events.js:64:17)
ERR! at afterRead (fs.js:1111:12)
ERR! Report this *entire* log at:
ERR!
ERR! or email it to:
ERR!
ERR!
ERR! System Darwin 10.8.0
ERR! command "node" "/Users/tjuricek/Applications/node/bin/npm" "install" "-g" "less"
ERR! cwd /Users/tjuricek
ERR! node -v v0.6.5
ERR! npm -v 1.1.0-alpha-6
ERR! message Invalid protocol
verbose exit [ 1, true ]

I'll note that we have a http_proxy in place, and we've had to change the registry setting to bypass the https protocol.

dhcp-11-n100:~ tjuricek$ npm config get registry
http://registry.npmjs.org/

Looking at main.js, however, it seems like there's something else that's just... wrong going on here.