isaacs/npm — Issue #1719: npm ERR! Error: Invalid protocol (Ubuntu11.10 $ npm search)
Author: jiyinyiyong
Created: 2011-11-16 00:57:19+00:00
State: open

Installed in Ubuntu 11.10 , I tried nodejs v0.6.1 first, nearly the same problem occured.
And I tried to install nodejs and npm from aptitude, also it put out this error:

$ npm search
npm WARN Building the index for the first time, please be patient
npm ERR! Error: Invalid protocol
npm ERR! at Request.request (/usr/local/lib/node_modules/npm/node_modules/request/main.js:223:31)
npm ERR! at request (/usr/local/lib/node_modules/npm/node_modules/request/main.js:457:5)
npm ERR! at makeRequest (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:122:13)
npm ERR! at regRequest (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:84:3)
npm ERR! at GET (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:213:3)
npm ERR! at requestAll_ (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/get.js:87:3)
npm ERR! at /usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/get.js:55:22
npm ERR! at cb (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:36:9)
npm ERR! at [object Object]. (fs.js:81:5)
npm ERR! at [object Object].emit (events.js:67:17)
npm ERR! Report this *entire* log at:
npm ERR!
npm ERR! or email it to:
npm ERR!
npm ERR!
npm ERR! System Linux 3.0.0-13-generic
npm ERR! command "node" "/usr/local/bin/npm" "search"
npm ERR! cwd /home/chen/kit/node-v0.5.10
npm ERR! node -v v0.5.10
npm ERR! npm -v 1.0.105
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/chen/kit/node-v0.5.10/npm-debug.log
npm not ok

$ cat vim npm-debug.log
info it worked if it ends with ok
verbose cli [ 'node', '/usr/local/bin/npm', 'search' ]
info using npm@1.0.105
info using node@v0.5.10
verbose config file /home/chen/.npmrc
verbose config file /usr/local/etc/npmrc
verbose config file /usr/local/lib/node_modules/npm/npmrc
WARN Building the index for the first time, please be patient
verbose GET /-/all
verbose raw, before any munging /-/all
verbose url resolving [ 'htp://npm.hacknodejs.com/', './-/all' ]
verbose url resolved htp://npm.hacknodejs.com/-/all
ERR! Error: Invalid protocol
ERR! at Request.request (/usr/local/lib/node_modules/npm/node_modules/request/main.js:223:31)
ERR! at request (/usr/local/lib/node_modules/npm/node_modules/request/main.js:457:5)
ERR! at makeRequest (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:122:13)
ERR! at regRequest (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:84:3)
ERR! at GET (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:213:3)
ERR! at requestAll_ (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/get.js:87:3)
ERR! at /usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/get.js:55:22
ERR! at cb (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:36:9)
ERR! at [object Object]. (fs.js:81:5)
ERR! at [object Object].emit (events.js:67:17)
ERR! Report this *entire* log at:
ERR!
ERR! or email it to:
ERR!
ERR!
ERR! System Linux 3.0.0-13-generic
ERR! command "node" "/usr/local/bin/npm" "search"
ERR! cwd /home/chen/kit/node-v0.5.10
ERR! node -v v0.5.10
ERR! npm -v 1.0.105
verbose exit [ 1, true ]