Skip to content

Commit 46f8949

Browse files
committed
update support nodejs 16, 18, 20
1 parent b3b73da commit 46f8949

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

install

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@ then
88
fi
99

1010
############################################
11-
# Install NodeJS, NVM, PM2, and grunt
11+
# Install NVM, NodeJS, PM2, and grunt
1212
############################################
1313

14-
# First install the latest NodeJS LTS version
15-
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
16-
apt-get install -y nodejs
14+
# NVM and prerequisites
15+
apt-get install -y curl gnupg2
16+
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
17+
source ~/.bashrc
18+
19+
# Initial install of NodeJS (20.6.1 is an LTS version)
20+
nvm install 20.6.1
21+
npm install -g npm@latest
1722

1823
# Install node version manager, globally
19-
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
2024
mv ~/.nvm /opt/nvm
2125
chmod -R 755 /opt/nvm
2226
export NVM_DIR="/opt/nvm"
@@ -25,21 +29,22 @@ export NVM_DIR="/opt/nvm"
2529
export PATH="/opt/nvm:$PATH"
2630

2731
# Install last three NodeJS LTS versions
28-
nvm install 14.21.2
29-
nvm install 16.19.0
30-
nvm install 18.13.0
31-
nvm alias default 18.13.0
32+
nvm install 16.20.2
33+
nvm install 18.17.1
34+
nvm alias default 20.6.1
35+
3236

3337
# Install grunt, pm2 globally for all versions
38+
nvm use v16
3439
npm install -g grunt-cli
3540
npm install -g pm2
36-
nvm use v16
41+
nvm use v18
3742
npm install -g grunt-cli
3843
npm install -g pm2
39-
nvm use v14
44+
nvm use v20
4045
npm install -g grunt-cli
4146
npm install -g pm2
42-
nvm use v18
47+
4348

4449
############################################
4550
# Install templates

0 commit comments

Comments
 (0)