节点在stream量供应期间安装,但在连接到ssh时消失

我真的厌倦了这一点,我不知道什么是错的。 我使用的是Vagrant 1.7.2Ubuntu 13.04Virtual Box 4.3 12 r93733

我的主机是Windows 8.1

这是我的bootstrap.sh上find的节点引导脚本

echo "--- Installing Node.js ---" curl https://raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | bash source ~/.nvm/nvm.sh nvm install 0.12 nvm use 0.12 sudo cp ~/.nvm/versions/nodejs/v0.12/bin/node /bin/node echo "--- Install node app dependencies --" cd /var/www/html/node npm install express npm install youtube-audio-stream 

在configuration期间,我可以看到该节点安装正确。 我可以看到Now using node v0.12 。 我也可以看到npm install是成功的

但是,当我连接使用stream浪SSH 。 我得到没有命令'nvm'find程序“节点”可以在下面的包中find: 。 我也检查了〜/ .nvm /目录,它不存在。

它变得更加怪异。 所以,当我在ssh时,我再次运行脚本。 然后nvm现在正确安装,我可以使用节点。

这是我想出来的

 echo "--- Installing Node.js ---" git clone https://github.com/creationix/nvm.git /home/vagrant/.nvm && cd /home/vagrant/.nvm && git checkout `git describe --abbrev=0 --tags` source /home/vagrant/.nvm/nvm.sh nvm install 0.12 nvm use 0.12 n=$(which node);n=${n%/bin/node}; chmod -R 755 $n/bin/*; sudo cp -r $n/{bin,lib,share} /usr/local