-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode_setup.sh
More file actions
32 lines (20 loc) · 723 Bytes
/
Copy pathnode_setup.sh
File metadata and controls
32 lines (20 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#install Node.js with Node Version Manager
apt-get install -y build-essential checkinstall curl
apt-get install -y libssl-dev
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | bash
#reflesh the environment
source ~/.profile
#list all the version
nvm ls-remote
#install version 6.X
nvm install 6
#show node version
node -v
#show npm version
npm -v
#set the current version to $node_version
node_version=$(echo $(node -v) )
#set $NODE_PATH for npm global modules for this session
export NODE_PATH=~/.nvm/versions/node/$node_version/lib/node_modules
#set $NODE_PATH every time the session start
echo "export NODE_PATH=~/.nvm/versions/node/$node_version/lib/node_modules" >>~/.profile