Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got Ubuntu v11.04 running on Win7 by VMPlayer. I've just finished a fresh installation of NodeJS v0.5.4-pre, and NPM v1.0.22. When attempting to install, I'm getting this:

ohad@ubuntu:~$ sudo npm install
npm ERR! registry error parsing json
npm ERR! SyntaxError: Unexpected token H
npm ERR! Host not found
npm ERR!     at Object.parse (native)
npm ERR!     at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:167:25)
npm ERR!     at IncomingMessage.emit (events.js:88:20)
npm ERR!     at HTTPParser.onMessageComplete (http2.js:133:23)
npm ERR!     at CleartextStream.ondata (http2.js:1095:22)
npm ERR!     at CleartextStream._push (tls.js:328:27)
npm ERR!     at SecurePair.cycle (tls.js:617:20)
npm ERR!     at EncryptedStream.write (tls.js:121:13)
npm ERR!     at Socket.ondata (stream.js:36:26)
npm ERR!     at Socket.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 2.6.38-10-generic
npm ERR! command "node" "/usr/local/bin/npm" "install" ""
npm ERR! cwd /home/ohad
npm ERR! node -v v0.5.4-pre
npm ERR! npm -v 1.0.22
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/ohad/npm-debug.log
npm not ok

Any ideas?

share|improve this question

migrated from Aug 4 '11 at 18:39

This question came from our site for professional and enthusiast programmers.

This fails because of a bug in the git master version of node, which is unstable. The solution is to run the stable version 0.4:

git clone && cd node

git checkout origin/v0.4



sudo make install

node -v

curl | sudo sh

After this, npm should be working as documented.

share|improve this answer

the https-git addresses are down - try again later...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.