我正在尝试关注 official site使用以下代码:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
但最终出现以下错误:
Some index files failed to download. They have been ignored, or old ones used instead. Error executing command, exiting
可能的解决方案是什么?
最佳答案
从上面的命令中,很明显您使用的是 Debian Linux Distro, 在终端上输入以下命令来安装 NodeJS:
- sudo apt-get install build-essential checkinstall
- sudo apt-get install libssl-dev
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
=> 关闭并重新打开终端,然后在终端上输入以下命令:
- 命令-v nvm
- nvm 安装 5.0
- nvm 使用 5.0
- nvm 别名默认 Node
以上将在您的机器上安装 NodeJS 5.0 版本。
希望这有帮助...
关于node.js - 为 React Native 安装 Node.js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46015214/