If using node.js's npm, you should do this first: npm config set registry http://registry.npmjs.org/ Otherwise, you'll get the "Error: socket hang up" error.