Skip to content

Instantly share code, notes, and snippets.

@ilyar
Last active August 29, 2015 13:58
Show Gist options
  • Save ilyar/10375737 to your computer and use it in GitHub Desktop.
Save ilyar/10375737 to your computer and use it in GitHub Desktop.
npm install local, tested on Ubuntu, is very likely on Windows (in git bash) will work too.
#!/bin/bash
# curl -sL https://deb.nodesource.com/setup_0.10 | sudo bash -
# or
# wget -qO- https://deb.nodesource.com/setup_0.10 | sudo bash -
# or
# curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -
# or
# wget -qO- https://deb.nodesource.com/setup_0.12 | sudo bash -
# sudo apt-get install -qq -y nodejs
echo "prefix=~/.local" > ~/.npmrc
echo "export NODE_PATH=\$NODE_PATH:~/.local/lib/node_modules" >> ~/.bashrc
echo "export PATH=~/.local/bin:\$PATH" >> ~/.bashrc
echo "export PATH=./node_modules/.bin:\$PATH" >> ~/.bashrc
source ~/.bashrc
npm i -g npm
# relogin terminal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment