From d42b1819cc3898cc134b644c61e6641817d12637 Mon Sep 17 00:00:00 2001 From: Johan Date: Wed, 23 Aug 2023 11:00:36 +0200 Subject: [PATCH] Update Node.JS.md --- BashScripts/uninstall-node.sh | 15 +++++++++++++++ Node.JS.md | 26 +++++++++++++++++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 BashScripts/uninstall-node.sh diff --git a/BashScripts/uninstall-node.sh b/BashScripts/uninstall-node.sh new file mode 100644 index 0000000..fc5ace5 --- /dev/null +++ b/BashScripts/uninstall-node.sh @@ -0,0 +1,15 @@ +REALUSER=$(logname) +NODEPATH=$(which node) +NPMPATH=$(which npm) + +# sudo apt purge --autoremove nodejs npm +if [ ! -z "${NODEPATH}" ]; then + sudo rm -rf $NODEPATH +fi +if [ ! -z "${NPMPATH}" ]; then + sudo rm -rf $NPMPATH +fi + + +echo "Uninstall complete. Node path: $NODEPATH, NPM path: $NPMPATH" +echo "Remember to run as both normal user and root" \ No newline at end of file diff --git a/Node.JS.md b/Node.JS.md index ece24ad..7f2a8ba 100644 --- a/Node.JS.md +++ b/Node.JS.md @@ -2,9 +2,33 @@ ### [Installera NVM](https://github.com/nvm-sh/nvm "Node Version Manager") -
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash && source ~/.bashrc
+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash
+ +Efter installation, avsluta aktuell SSH session och logga in igen. ### Installera Node.JS version
nvm install 16.13 && nvm use 16.13
+### Uppdatera moduler + +Lista installerade moduler + +
npm list
+
npm list -g
+ +Sök efter uppdateringar + +
npm audit
+ +Sök efter uppdateringar för bara production + +
npm audit --production
+ +### npm-check-updates + +ncu -u uppdaterar bara package.json, kör därför npm i efteråt + +
npm install -g npm-check-updates
+ncu -u
+npm install