I am setting up a vagrant box (VM) to mimic a server. The idea is that you initialize the VM by running one command and it provisions itself using a single bash script file, "bootstrap.sh".
I am trying to run ember on my VM.
So in the script file, I install node, nvm, npm, and all other kinds of dependencies and stuff. Just for reference, this is what the file looks like:
echo "installing node version manager"
curl http://ift.tt/1DlTrMZ | bash
source ~/.nvm/nvm.sh
# EMBER CLI & DEPENDENCIES ...
# Install node.js
echo "Installing node.js"
nvm install stable
nvm use stable
# Symlink node to node.js
echo "node symlink"
ln -s /usr/bin/nodejs /usr/bin/node
# Install npm
echo "Installing node package manager"
apt-get install -y npm
# Install Ember CLI
echo "Installing Ember CLI"
npm install -g ember-cli
# Install Bower
echo "Installing bower"
sudo npm install -g bower
# Install watchman from source
apt-get install -y autoconf automake
git clone http://ift.tt/1NDIdGH
cd watchman
./autogen.sh
./configure
make
make install
cd
# Install Phantom.js
echo "Installing Phantom.js"
sudo npm install -g phantomjs
# Do some weird path thing that makes npm find Ember (?)
echo "Creating path for node modules"
export PATH=node_modules/.bin:$PATH
But when i run ember s
it says "ember: command not found".
If i rerun this line in the VM:
export PATH=node_modules/.bin:$PATH
then it works.
So it seems that export PATH=node_modules/.bin:$PATH
does not work form the shell script file, but it does work if you run it from the command-line (on the VM via ssh)
Why is this happening and how can I make this command run the same from the script file, as if it were run from command-line?
Aucun commentaire:
Enregistrer un commentaire