NodeJS
Option 1) CURL
Install v23.x using curl
| Step 1 | curl -fsSL https://deb.nodesource.com/setup_23.x | sudo bash - |
| Step 2 | sudo apt-get install -y nodejs |
| Test | node -v |
Remove
| Step 1 | sudo apt-get remove nodejs npm |
| Step 2 | sudo apt-get purge nodejs npm |
| Step 3 | sudo apt-get autoremove |
| Test | node -v |
Option 2) Node Version Manager
Install v23.10.0
| Step 1 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash |
| Step 2 | Close and re-open terminal window |
| Test | command -v nvm |
| Step 3 | nvm ls-remote |
| Step 4 | nvm install 23.10.0 |
| Test | node -v |
Remove
| Step 1 | nvm deactivate |
| Step 2 | nvm uninstall node |
| Step 3.1 | nvm_dir="${NVM_DIR:-~/.nvm}" |
| Step 3.2 | nvm unload |
| Step 3.3 | rm -rf "$nvm_dir" |
| edit ~/.bashrc remove lines below.. | |
| Step 4 | export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [[ -r $NVM_DIR/bash_completion ]] && \. $NVM_DIR/bash_completion |
| Test | node -v |