nvm -> install_node

This commit is contained in:
Patrick Niklaus 2016-12-09 16:30:14 +00:00
parent ad3fd46da5
commit 8c21e1267e
No known key found for this signature in database
GPG Key ID: E426891B5F978B1B

View File

@ -1,13 +1,16 @@
#!/usr/bin/env bash #!/usr/bin/env bash
export NVM_NODEJS_ORG_MIRROR=https://s3.amazonaws.com/mapbox/vendor/nodejs export NODE_HOME=$HOME/node
mkdir ${NODE_HOME}
if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
curl https://s3.amazonaws.com/mapbox/apps/install-node/v2.0.0/run | NV=4.4.2 NP=darwin-x64 OD=${NODE_HOME} sh
else
curl https://s3.amazonaws.com/mapbox/apps/install-node/v2.0.0/run | NV=4.4.2 NP=linux-x64 OD=${NODE_HOME} sh
fi
# here we set up the node version on the fly. currently only node 4, but can be used for more values if need be export PATH="${NODE_HOME}:$PATH"
# This is done manually so that the build works the same on OS X
rm -rf ~/.nvm/ && git clone --depth 1 --branch v0.30.1 https://github.com/creationix/nvm.git ~/.nvm
source ~/.nvm/nvm.sh
nvm install $1
nvm use $1
node --version node --version
npm --version npm --version
which node which node