Skip to content

Instantly share code, notes, and snippets.

@rgjr
Created February 28, 2019 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rgjr/67f97575f4fc4c536f0994b8afd3e6a2 to your computer and use it in GitHub Desktop.
Save rgjr/67f97575f4fc4c536f0994b8afd3e6a2 to your computer and use it in GitHub Desktop.
##
# add this to your provision.sh
#
# [!] run as 'vagrant' like this:
# su vagrant -c "source ${PROVISION_DIR}/provision-node.sh"
#
# [!] please keep the echo messages.
# [!] those actions could take some more time without any output, so let the user know.
#
# NVM info: https://github.com/creationix/nvm#usage
##
# install latest nvm
git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`
# optional curl: curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
source ~/.nvm/nvm.sh
echo "source ~/.nvm/nvm.sh" >> ~/.bashrc
# install and switch default to use latest stable node.js
echo "Installing node.js... (please be patient)"
nvm install node
nvm use node
# use nvm to update to latest npm
nvm install-latest-npm
# install global node packages
# echo "Installing global node.js packages... (please be patient)"
# add any global packages you want here, ex:
# npm install -g gulp bower npm-check-updates
# install project dependencies and build
cd /vagrant/
echo "Installing local node.js packages... (please be patient)"
npm install
composer install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment