Skip to content

Commit 77cf107

Browse files
committed
Created installation script
Using NVM for node version management Not completetly automated since it requires reloading the shell afterward to propogate environment variables
1 parent 2402436 commit 77cf107

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

scripts/install.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
3+
# get this script's directory
4+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5+
6+
# elevate to root
7+
echo ""
8+
sudo -v -p "Please enter the administrator's password: "
9+
10+
# install NVM for easy node version management
11+
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | sh
12+
# source nvm to access it in the shell
13+
# usually it is source in .bashrc,
14+
# but we can't reload .bashrc within a script
15+
source ~/.nvm/nvm.sh
16+
# install latest tested stable Nodejs
17+
nvm install 5.0.0
18+
# set 5.0.0 as default system Nodejs version
19+
# this means 5.0.0 will be in the $PATH when you boot
20+
nvm alias default 5.0.0
21+
22+
# install chromium from package repository
23+
sudo apt-get update
24+
sudo apt-get install chromium
25+
26+
# now install Nodejs dependencies
27+
cd $DIR
28+
cd ..
29+
npm install
30+
31+
echo "You must restart your shell, or run the following command: source ~/.bashrc"

0 commit comments

Comments
 (0)