2011-06-17 129 views
7

安装使用下面的命令NPM的安装问题的Ubuntu 11.04

sudo apt-get install git-core curl build-essential openssl libssl-dev 
git clone https://github.com/joyent/node.git && cd node 
./configure 
make 
make install 
node -v 
v0.5.0-pre 

作品清新节点无故障。当我尝试安装NPM我得到:

>/tmp/node$ curl http://npmjs.org/install.sh | sudo sh 
    % Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 
100 3874 100 3874 0  0 3033  0 0:00:01 0:00:01 --:--:-- 22923 
fetching: 

gzip: stdin: unexpected end of file 
tar: This does not look like a tar archive 
tar: Exiting with failure status due to previous errors 
It failed 
> 

我使用的是VirtualBox的NAT用的方式没有特殊的代理/防火墙的网络。

试图curl -s -L http://registry.npmjs.org/npm/latest我得到{"error":"ucs","reason":"{bad_utf8_character_code}"}
这可能暗示一个NPM方面的问题?

拉尔夫

+0

但是考虑到这会安装最新版本的节点,并且可能会破坏兼容性。例如,当运行lesscss时,它可能需要节点0.4.12,而在编写thios注释时,自动下载的版本是0.7.9。看到这篇文章:http://stackoverflow.com/questions/7717623/getting-an-error-when-running-the-less-css-compiler-in-node-js – 2012-05-22 20:51:56

回答

12

试试这个:

git clone http://github.com/isaacs/npm.git 
cd npm 
sudo make install 
+0

伟大 - 这给了我一个工作NPM。但是我仍然迷失了,因为URL http://registry.npmjs.org/npm下没有工作存储库 – 2011-06-17 09:29:23

0

似乎有与此刻的NPM注册表中的问题 - 我得到了同样的错误,使用Git安装,然后发现注册表也在下降。

有关注册表关闭的更多信息,请参见https://github.com/isaacs/npm/issues - 整个NPM可能存在问题。