Answers for "how to remove old version of node js mac"

9

uninstall node js from mac

sudo rm -rf ~/.npm ~/.nvm ~/node_modules ~/.node-gyp ~/.npmrc ~/.node_repl_history
sudo rm -rf /usr/local/bin/npm /usr/local/bin/node-debug /usr/local/bin/node /usr/local/bin/node-gyp
sudo rm -rf /usr/local/share/man/man1/node* /usr/local/share/man/man1/npm*
sudo rm -rf /usr/local/include/node /usr/local/include/node_modules
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /usr/local/lib/dtrace/node.d
sudo rm -rf /opt/local/include/node /opt/local/bin/node /opt/local/lib/node
sudo rm -rf /usr/local/share/doc/node
sudo rm -rf /usr/local/share/systemtap/tapset/node.stp

brew uninstall node
brew doctor
brew cleanup --prune-prefix
Posted by: Guest on July-07-2020
0

remove old version of node and install new

First remove previous version
$ sudo apt remove nodejs
Installing Node.js with Apt Using a NodeSource PPA
cd ~
curl -sL https://deb.nodesource.com/setup_16.x -o nodesource_setup.sh
Inspect the contents of the downloaded script with nano (or your preferred text editor):
nano nodesource_setup.sh
When you are satisfied that the script is safe to run, exit your editor, then run the script with sudo
sudo bash nodesource_setup.sh
The PPA will be added to your configuration and your local package cache will be updated automatically. You can now install the Node.js package in the same way you did in the previous section:

sudo apt install nodejs
Verify that you’ve installed the new version by running node with the -v version flag:
node -v
Posted by: Guest on December-21-2021

Code answers related to "how to remove old version of node js mac"

Code answers related to "Javascript"

Browse Popular Code Answers by Language