npm安装包失败

1
2
npm http GET https://registry.npmjs.org/socket.io
npm ERR! Error: failed to fetch from registry: socket.io

问题是HTTPS访问失败,设置为HTTP访问即可解决:

1
npm config set registry http://registry.npmjs.org/

老版本ubuntu server node(0.6) 无法更新

1
2
3
4
apt-get install python-software-properties
apt-add-repository ppa:chris-lea/node.js
apt-get update
apt-get install nodejs