我正在使用vagrant shell provisioning来安装节点grunt和bower。
由于某种原因,流浪者说:
==> default: /tmp/vagrant-shell: line 8: npm: command not found ==> default: /tmp/vagrant-shell: line 9: npm: command not found The SSH command responded with a non-zero exit status. Vagrant
但是当我使用vagrant ssh登录到机器时,找到了npm命令,我可以正常使用它。
Vagrantfile:
# -*- mode: ruby -*- # vi: set ft=ruby : $script = <<SCRIPT yum -y update; yum -y groupinstall "Development Tools"; wget http://nodejs.org/dist/v0.11.9/node-v0.11.9.tar.gz -P /usr/src; tar zxf /usr/src/node-v0.11.9.tar.gz -C /usr/src; /usr/src/node-v0.11.9/configure; make -C /usr/src/node-v0.11.9/; make install -C /usr/src/node-v0.11.9/; npm install -g grunt-cli; npm install -g bower; SCRIPT Vagrant.configure(2) do |config| config.vm.box = "chef/centos-6.5" config.ssh.username = 'root' config.ssh.password = 'vagrant' # config.vm.network "public_network" config.vm.provision "shell", inline: $script end