-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode-install.sh
More file actions
25 lines (21 loc) · 1.03 KB
/
node-install.sh
File metadata and controls
25 lines (21 loc) · 1.03 KB
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
#!/bin/bash
touch ~/node-setup-output.txt
#NVM:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.nvm/nvm.sh
source ~/.profile
source ~/.bashrc
echo "NVM installed. Version:" | tee -a ~/node-setup-output.txt
nvm --version | tee -a ~/node-setup-output.txt
echo 'You can check this is the latest release by comparing it to: https://github.com/nvm-sh/nvm - under "Releases".' | tee -a ~/node-setup-output.txt
# Node:
nvm install --lts
echo "Node installed. Version:" | tee -a ~/node-setup-output.txt
node -v | tee -a ~/node-setup-output.txt
echo 'You can check this is the latest release by comparing it to: https://nodejs.org/en/download.' | tee -a ~/node-setup-output.txt
# NPM:
npm install -g npm@latest
echo "NPM installed. Version:" | tee -a ~/node-setup-output.txt
npm -v | tee -a ~/node-setup-output.txt
echo 'You can check this is the latest release by comparing it to: https://github.com/npm/cli - under "Releases".' | tee -a ~/node-setup-output.txt
source ~/.bashrc # Refresh terminal one last time