-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using NVM for node version management Not completetly automated since it requires reloading the shell afterward to propogate environment variables
- Loading branch information
1 parent
2402436
commit 77cf107
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
# get this script's directory | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
# elevate to root | ||
echo "" | ||
sudo -v -p "Please enter the administrator's password: " | ||
|
||
# install NVM for easy node version management | ||
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | sh | ||
# source nvm to access it in the shell | ||
# usually it is source in .bashrc, | ||
# but we can't reload .bashrc within a script | ||
source ~/.nvm/nvm.sh | ||
# install latest tested stable Nodejs | ||
nvm install 5.0.0 | ||
# set 5.0.0 as default system Nodejs version | ||
# this means 5.0.0 will be in the $PATH when you boot | ||
nvm alias default 5.0.0 | ||
|
||
# install chromium from package repository | ||
sudo apt-get update | ||
sudo apt-get install chromium | ||
|
||
# now install Nodejs dependencies | ||
cd $DIR | ||
cd .. | ||
npm install | ||
|
||
echo "You must restart your shell, or run the following command: source ~/.bashrc" |