Having vagrants having problems with npm

I am using vagrant shell to install node grunt and bower.

for some reason the tramp says:

==> 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

      

but when I log into the roaming ssh machine the npm command is found and I can use it just fine.

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

      

+3


source to share





All Articles