2014-06-18 119 views
1

没有发现请大家帮我清除此错误NPM错误NPM在终端

Apples-Mac-mini:bin apple$ curl -L http://npmjs.org/install.sh | sh 
    % Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 
100 193 100 193 0  0 244  0 --:--:-- --:--:-- --:--:-- 471 
100 6711 100 6711 0  0 431  0 0:00:15 0:00:15 --:--:-- 5456 
sh: line 20: npm-install-3294.sh: Permission denied 
sh: npm-install-3294.sh: No such file or directory 
rm: npm-install-3294.sh: No such file or directory 

回答

2

curl -L http://npmjs.org/install.sh | sudo sh

注意前面的sudo。您收到的错误是由于安装程序尝试将文件复制到系统文件夹,需要管理权限。

此外,您实际上不需要安装NPM,因为它包含在最新的Node.js版本中。 要在MacOS上安装Node.js,请参阅their official site

+1

感谢朋友Alandarev – JoPrithivi

0

要解决它,运行SH使用sudo:

$ curl http://npmjs.org/install.sh | sudo sh