Tuesday, January 7, 2025
HomeProgrammingHow do I completely uninstall Node.js, and reinstall

How do I completely uninstall Node.js, and reinstall

On Ubuntu:

  1. Uninstall:
    bash
    sudo apt-get remove --purge nodejs npm
    sudo apt-get autoremove
    sudo apt-get autoclean
  2. Delete remaining files:
    bash
    sudo rm -rf /usr/local/lib/node_modules /usr/local/bin/node /usr/local/bin/npm ~/.npm
  3. Reinstall:
    bash
    curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
    sudo apt-get install -y nodejs
  4. Verify:
    bash
    node -v
    npm -v

On Windows:

  1. Uninstall:
    • Go to Control Panel > Programs > Programs and Features.
    • Right-click Node.js and select Uninstall.
  2. Delete remaining files:
    • Delete Node.js folders in C:\Program Files\nodejs and C:\Users\YourName\AppData\Roaming\npm.
  3. Reinstall:
  4. Verify: Open Command Prompt or PowerShell and run:
    bash
    node -v
    npm -v
RELATED ARTICLES
0 0 votes
Article Rating

Leave a Reply

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
- Advertisment -

Most Popular

Recent Comments

0
Would love your thoughts, please comment.x
()
x