feat: adjust doc/node.md
This commit is contained in:
parent
bd99bcf57e
commit
41f62ac3c8
43
doc/node.md
43
doc/node.md
|
@ -12,53 +12,42 @@ sudo apt update
|
||||||
sudo apt-get install nodejs npm --no-install-recommends
|
sudo apt-get install nodejs npm --no-install-recommends
|
||||||
```
|
```
|
||||||
|
|
||||||
## Using NVM Update
|
## Using NVM
|
||||||
|
|
||||||
* configure Node.js: [Here](https://github.com/nvm-sh/nvm) we find a bash script to manage multiple active node.js versions
|
* configure Node.js: [Here](https://github.com/nvm-sh/nvm) we find a bash script to manage multiple active node.js versions
|
||||||
```
|
```
|
||||||
node -v
|
node -v
|
||||||
which node
|
which node
|
||||||
less ~/.profile
|
|
||||||
touch ~/.profile
|
|
||||||
chmod 700 ~/.profile
|
chmod 700 ~/.profile
|
||||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
|
||||||
cat ~/.profile
|
|
||||||
command -v nvm
|
command -v nvm
|
||||||
nvm -v
|
nvm -v
|
||||||
. ~/.profile
|
. ~/.profile
|
||||||
nvm -v
|
nvm -v
|
||||||
command -v nvm
|
command -v nvm
|
||||||
echo $NVM_DIR
|
echo $NVM_DIR
|
||||||
|
```
|
||||||
|
|
||||||
|
* OPTION: log out and log in again so that the configuration is updated
|
||||||
|
|
||||||
|
* Select and Install a Node.js version
|
||||||
|
```
|
||||||
nvm version-remote --lts
|
nvm version-remote --lts
|
||||||
nvm ls-remote| grep 'Latest LTS'| grep v10
|
nvm ls-remote| grep 'Latest LTS'| grep v10
|
||||||
nvm i <lts>
|
nvm i <lts>
|
||||||
|
```
|
||||||
|
|
||||||
|
* NOTE: Make sure node.js is available in the correct version
|
||||||
|
```
|
||||||
which node
|
which node
|
||||||
|
```
|
||||||
|
|
||||||
|
* OPTION: Compare nvm's and user's Node.js version
|
||||||
|
```
|
||||||
/usr/bin/node -v
|
/usr/bin/node -v
|
||||||
node -v
|
node -v
|
||||||
```
|
```
|
||||||
|
|
||||||
## Using NVM
|
|
||||||
|
|
||||||
* install curl command-line utility
|
|
||||||
```
|
|
||||||
sudo apt install curl --no-install-recommends
|
|
||||||
```
|
|
||||||
|
|
||||||
* execute NVM installation bash script with your user
|
|
||||||
```
|
|
||||||
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
|
|
||||||
```
|
|
||||||
|
|
||||||
* apply the new settings
|
|
||||||
```
|
|
||||||
source ~/.bashrc
|
|
||||||
```
|
|
||||||
|
|
||||||
* install latest stabe node version
|
|
||||||
```
|
|
||||||
nvm install node --lts
|
|
||||||
```
|
|
||||||
|
|
||||||
### Helpful NVM instructions
|
### Helpful NVM instructions
|
||||||
|
|
||||||
* install specific node version
|
* install specific node version
|
||||||
|
|
Loading…
Reference in New Issue