我需要在没有root权限的计算机上安装npm,由于缺少依赖项,我会遇到许多错误。 我附上屏幕截图。 有什么想法吗?谢谢。
来自 node.js 贡献者 isaacs 的话:
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install
curl https://www.npmjs.org/install.sh | sh
高级安装(Unix)
在https://www.npmjs.com/install.sh上有一个相当强大的安装脚本。您可以下载并运行它。
以下是使用curl的示例:
curl -L https://npmjs.com/install.sh | sh