Skip to content

Instantly share code, notes, and snippets.

@dled
Last active December 18, 2017 12:17
Show Gist options
  • Save dled/a3f3d3c67508d52d46ba0d5fcfadb1a9 to your computer and use it in GitHub Desktop.
Save dled/a3f3d3c67508d52d46ba0d5fcfadb1a9 to your computer and use it in GitHub Desktop.
Starter setup for Node.js & npm on Ubuntu 16.04-2 LTS
# installing node.js v6.10.0 on ubuntu 16.04.2 lts (xenial xerus)
# script written for interactive reference only (no apt install -y flags..etc.)
# 2017 03 19
sudo apt install dkms linux-headers-$(uname -r)
sudo apt install automake checkinstall build-essential libapparmor-dev
sudo apt install git git-core svn subversion apt-transport-https curl
# developer libraries and common R pkg dependencies
sudo apt install libssl-dev libxml2-dev libz3-dev libpng-dev libjpeg-dev
sudo apt install gcc g++ cmake libcurl4-gnutls-dev libgnutls-openssl27
# install node-v6.10.0
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt install -y nodejs
node -v
# install npm & fix permissions
# vs. NPM_CONFIG_PREFIX=~/.npm-global
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
sudo echo "export PATH=~/.npm-global/bin:$PATH" | sudo tee -a ~/.profile
. ~/.profile
# install dropbox
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
npm -v
# update npm
npm install npm@latest -g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment