Vagrant:错误安装'gulp'
问题描述:
我正在运行vagrant provision
,并且最后一步失败,并显示“错误安装'gulp'”。见下文。Vagrant:错误安装'gulp'
这是什么意思,以及如何解决它?没有人跑这个流浪脚本曾经有过这个问题。
Stderr from the command:
stdin: is not a tty
[ERROR ] Command 'npm install --silent --json --global "gulp"' failed with return code: 1
[ERROR ] stdout:
> [email protected] install /usr/local/lib/node_modules/gulp/node_modules/v8flags
> node fetch.js
[ERROR ] stderr: sh: 1: node: not found
[ERROR ] Error installing 'gulp': sh: 1: node: not found
我尝试手动安装$ sudo npm install --json --global "gulp"
但它给了我一个错误:
> [email protected] install /usr/local/lib/node_modules/gulp/node_modules/v8flags
> node fetch.js
sh: 1: node: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
答
NPM是Node.js的安装程序包,你的错误消息指出节点找不到。
- 是否将节点安装为设置的一部分?
- 节点的路径是否正确设置?
答
解决我的问题是要安装这个包直接在虚拟机并重新运行vagrant provision
:
sudo apt-get install nodejs-legacy
这是帮我参考:Cannot install packages using node package manager in Ubuntu
我找到了解决办法:HTTP:// stackoverflow.com/questions/21168141/can-not-install-packages-using-node-package-manager-in-ubuntu – Vad 2014-10-29 21:14:30