Last active
March 3, 2016 21:25
-
-
Save pterk/59016a80689d72f0e610 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
VERSION="v5.7.1" | |
ARCH="linux-x64" | |
ARCHIVE="node-${VERSION}-${ARCH}.tar.gz" | |
URL="https://nodejs.org/dist/${VERSION}/${ARCHIVE}" | |
if [ -z "${VIRTUAL_ENV}" ]; then | |
echo "Please activate a virtualenv first"; | |
exit | |
fi | |
#echo $URL | |
#exit | |
pushd /tmp/ | |
mkdir -p _node && cd $_ && wget $URL -O - | tar zxf - --strip-components=1 # downloads and unzips the content to _node | |
cp -r ./lib/node_modules/ ${VIRTUAL_ENV}/lib/ # copy the node modules folder to the /lib/ folder | |
cp -r ./include/node ${VIRTUAL_ENV}/include/ # copy the /include/node folder to /usr/local/include folder | |
cp bin/node ${VIRTUAL_ENV}/bin/ # copy node to the bin folder | |
ln -s "${VIRTUAL_ENV}/lib/node_modules/npm/bin/npm-cli.js" ${VIRTUAL_ENV}/bin/npm ## making the symbolic link to npm | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Installs a pre-build node-js in a virtual environment