From 41f62ac3c8b9a816d2ea510557dec6f5c34ec5f8 Mon Sep 17 00:00:00 2001 From: "Begerad, Stefan" Date: Wed, 13 Sep 2023 07:37:25 +0200 Subject: [PATCH] feat: adjust doc/node.md --- doc/node.md | 43 ++++++++++++++++--------------------------- 1 file changed, 16 insertions(+), 27 deletions(-) diff --git a/doc/node.md b/doc/node.md index e3a58d8..3f244f3 100644 --- a/doc/node.md +++ b/doc/node.md @@ -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 +``` + +* 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