feat: adjust doc/node.md

This commit is contained in:
dancingCycle 2023-09-13 07:37:25 +02:00
parent bd99bcf57e
commit 41f62ac3c8
1 changed files with 16 additions and 27 deletions

View File

@ -12,53 +12,42 @@ sudo apt update
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
```
node -v
which node
less ~/.profile
touch ~/.profile
chmod 700 ~/.profile
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
cat ~/.profile
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
command -v nvm
nvm -v
. ~/.profile
nvm -v
command -v nvm
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 ls-remote| grep 'Latest LTS'| grep v10
nvm i <lts>
```
* NOTE: Make sure node.js is available in the correct version
```
which node
```
* OPTION: Compare nvm's and user's Node.js version
```
/usr/bin/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
* install specific node version