How to delete node js windows

I uninstalled my previous version of node.js (0.8.11) and downloaded the latest, 0.10.24 from the node.js website and installed it. However, after running node --version, it still indicates that I'm

Scenario: Removing NodeJS when Windows has no Program Entry for your Node installation

I ran into a problem where my version of NodeJS (0.10.26) could NOT be uninstalled nor removed, because Programs & Features in Windows 7 (aka Add/Remove Programs) had no record of my having installed NodeJS… so there was no option to remove it short of manually deleting registry keys and files.

Command to verify your NodeJS version: node --version

I attempted to install the newest recommended version of NodeJS, but it failed at the end of the installation process and rolled back. Multiple versions of NodeJS also failed, and the installer likewise rolled them back as well. I could not upgrade NodeJS from the command line as I did not have SUDO installed.

SOLUTION: After spending several hours troubleshooting the problem, including upgrading NPM, I decided to reinstall the EXACT version of NodeJS on my system, over the top of the existing installation.

That solution worked, and it reinstalled NodeJS without any errors. Better yet, it also added an official entry in Add/Remove Programs dialogue.

Now that Windows was aware of the forgotten NodeJS installation, I was able to uninstall my existing version of NodeJS completely. I then successfully installed the newest recommended release of NodeJS for the Windows platform (version 4.4.5 as of this writing) without a roll-back initiating.

It took me a while to reach sucess, so I am posting this in case it helps anyone else with a similar issue.

Improve Article

Save Article

  • Read
  • Discuss
  • Improve Article

    Save Article

    We can completely remove Node.js from windows using the following simple steps:

    Step 1: Whenever we install a package with command npm install <package name>, npm stores the cache inside the user file system. The default directory where the cache data is stored on Windows is %AppData%/npm-cache. So, we need to clean the cache first. The cache can be cleaned by using the following command.

    npm cache clean --force 

    Step 2: After that, you can verify the cache by using the below command:

    npm cache verify

    Step 3: Now open control panel in the computer. Search for Program and features. Under the program and features click on Uninstall a program. Now search for Node.js and uninstall it.

    Step 4: Restart your computer or kill all node-related processes from Task Manager.

    Step 5: Look for folder in your computer and if they are present remove them. The folders and files may or may not exist in your computer depending on various factors like installed version or CPU architecture.

    • C:Program Files (x86)Nodejs
    • C:Program FilesNodejs
    • C:Users{User}AppDataRoamingnpm or open run and type appdata and click ok and open roaming there you will find npm.
    • C:Users{User}AppDataRoamingnpm-cache or open run and type appdata and click ok and open roaming there you will find npm-cache.
    • C:Users{User}.npmrc
    • C:Users{User}package.json
    • C:Users{User}package-lock.json
    • C:Users{User}AppDataLocalTempnpm-*                       

    Step 6: After that check the environment path variables and make sure no references to npm or Node.js exist.

    Step 7: If Node.js is still not uninstalled then open the command prompt and type the below command:

    where node

    Step 8: If Node.js is not uninstalled the command will output the location of Node.js. Go to that location and uninstall the directory.

    Step 9: Restart the computer. Node.js is now completely uninstalled.

    There is no restriction on the type of programming language used for writing server-side code. Some of the popular examples include PHP, Ruby, C#, Python, and Javascript. Out of all these, Javascript is very much popular because of its beginner-friendliness and being able to be used both on the client-side and server-side as well.

    As the server-side runtime environment for Javascript, Node.js lets you build scalable web applications with ease. Despite its popularity among beginning developers, Node.js does not fit every developer’s needs, especially those with different language backgrounds or preferences.

    This tutorial will walk you through a step-by-step guide to completely remove Node.js from your computer. Let’s take a deep breath and dive right in!

    Live New Year Sale. Become The Best Full-Stack Developer 🚀

    Get access to hunderes of practice Node.js courses, labs, and become employable full-stack web developer.

    • Free money-back guarantee
    • Unlimited access to all platform courses
    • 100’s of practice projects included
    • ChatGPT Based Instant AI Help
    • Structured Node.js Full-Stack Roadmap To Get A Job
    • Exclusive community for events, workshops

    Go Pro Now (50% Discount For Limited Time)

    Prerequisites

    Before uninstalling Node.js, it is important that we check if Node.js is properly installed in our system or not. The way we can check that varies by the operating system.

    Check if Node.js installed on Windows

    • Using File Explorer:
      1. Go to File Explorer, open This PC -> C:/ drive.
      2. Look for the Nodejs folder in the directory where you installed Nodejs originally.
      3. Some of the other files where we can check for Nodejs or npm files:
        • C:Program Files (x86)Nodejs
        • C:Program FilesNodejs
        • C:Users"user"AppDataRoamingnpm
        • C:Users"user"AppDataRoamingnpm-cache
      4. The folder indicates that Nodejs is installed correctly in your system.

    Using CMD:

    • Search for “cmd” in the start menu. Right-click on it and select “Run as administrator”.
    • Or, Press Win+R to open “run”. Enter “cmd” and hit Ctrl+Shift+Enter to open the command prompt as administrator.
    • Write the following command:

    node --version

    Code language: JavaScript (javascript)

    If you get a result like this, it indicates Node is correctly installed on your system:

    v16.16.0

    Code language: JavaScript (javascript)

    Check if Node.js installed on Linux

    You can check if Node.js is installed by typing node -v in Terminal. The version number will appear in the terminal. It should look something like this:

    v16.16.0

    Code language: JavaScript (javascript)

    Check if Node.js installed on Mac

    1. Press command+space to open Spotlight Search.
    2. Type “Terminal” and press enter.
    3. Check if Node.js is installed by typing node -v in Terminal.
    4. You should see the version of Node.js that was installed, something like this:

    v16.16.0

    Code language: JavaScript (javascript)

    Uninstalling the Node.js in Windows

    There are actually three ways through which we can remove Node.js from our windows system. Let’s have a look at each of them.

    Method 1: Uninstalling from Windows Settings

    • Go to Settings by searching it in the start menu.
    • Click on the Apps section.
    • Look for the search box under Apps & Features section, and enter Nodejs there.
    • Select on Nodejs application and click on uninstall.
    • It is recommended that you restart your Windows machine even if you aren’t prompted to do so.
    • Lastly, run cmd as administrator and type:

    node --version

    Code language: JavaScript (javascript)
    • If you see an output like this: 'node' not recognized as internal or external commandthen Node is successfully uninstalled from your computer.

    Method 2: Uninstalling from Windows CMD

    • Search for “cmd” in the start menu. Right-click on it and select “Run as administrator“.
    • Or, Press Win+R to open “run“. Enter “cmd” and hit Ctrl+Shift+Enter to open the command prompt as administrator.
    • Run the following command in your terminal to clear your npm cache:

    npm cache clean --force

    Code language: JavaScript (javascript)
    • Now, to remove Node.js and npm successfully:
      • Go to the windows control panel.
      • Select Uninstall a program.
      • Right-Click on Nodejs and uninstall.
    • Lastly, run cmd as administrator and type:

    node --version

    Code language: JavaScript (javascript)
    • If you see an output like this: 'node' not recognized as internal or external commandthen Node is successfully uninstalled from your computer.

    Method 3: Uninstalling from Windows Registry

    • Search for “Registry Editor” in the start menu and click on it.
    • Or, Press Win+R to open “run“. Enter “regedit” and hit Enter to open the Windows Registry.
    • A prompt will open asking you to allow the app to make changes. Click Yes.
    • You can either go to the path below or paste it in the path field: ComputerHKEY_LOCAL_MACHINESOFTWARENode.js
    • As a next step, locate the Nodejs directory on the left sidebar. Right-click on it and delete the directory.
    • It is recommended that you restart your Windows machine even if you aren’t prompted to do so.
    • Lastly, run cmd as administrator and type:

    node --version

    Code language: JavaScript (javascript)
    • If you see an output like this: 'node' not recognized as internal or external commandthen Node is successfully uninstalled from your compute

    Uninstalling the Node.js in Ubuntu

    We will examine multiple options to uninstall NodeJS in Ubuntu using the three typical commands: uninstall, remove and purge.

    Step 1: Locating the Binary Files

    You can locate the folder where NodeJS binaries are located and verify if it’s uninstalled as well. This can be done using the which or find command as shown below:

    $ which node $ find $(echo $PATH | sed 's/:/ /g') -name "node"

    Code language: JavaScript (javascript)

    $ find / -name "node"

    Code language: JavaScript (javascript)

    You should see an output similar to this if the node is installed:

    /user/bin/node /user/bin/node

    Code language: JavaScript (javascript)

    /user/bin/node /user/share/doc/node /user/share/code/resources/app/extensions/emmet/dist/node /user/share/code/resources/app/extensions/css-language-features/server/dist/node /user/share/code/resources/app/extensions/css-language-features/client/dist/node /user/share/code/resources/app/extensions/ms-vscode.js-debug/src/targets/node /user/share/code/resources/app/extensions/html-language-features/server/dist/node /user/share/code/resources/app/extensions/html-language-features/client/dist/node /user/share/code/resources/app/extensions/json-language-features/server/dist/node /user/share/code/resources/app/extensions/json-language-features/client/dist/node /user/share/code/resources/app/out/vs/workbench/api/node /user/share/code/resources/app/out/vs/workbench/contrib/debug/node /user/share/code/resources/app/out/vs/workbench/contrib/externalTerminal/node /user/share/code/resources/app/out/vs/base/node /user/share/code/resources/app/out/vs/platform/files/node /user/share/code/resources/app/out/vs/platform/environment/node /user/share/code/resources/app/out/vs/platform/terminal/node j/user/share/code/resources/app/out/vs/code/node /user/include/node

    Code language: JavaScript (javascript)

    Step 2: Uninstalling NodeJS

    Now, there are different ways of removing Nodejs from the system. Let’s look at some of the options below:

    Method 1: Removing the binary paths

    We can discard Nodejs by manually deleting the binaries we located in the previous step, although this method is less recommended than others.

    $ sudo rm /user/bin/node

    Code language: JavaScript (javascript)

    Method 2: Use the apt or apt-get command to Uninstall

    The most commonly used commands in Ubuntu to uninstall NodeJS are apt and apt-get.

    $ sudo apt-get remove nodejs

    Code language: JavaScript (javascript)

    The above command only removes the package. In order to remove all the node-related packages as well, see the methods in step 4.

    Method 3: Uninstalling a Particular version of NodeJS

    Suppose you want to uninstall only a specific version of NodeJS. You can use the below command to remove that version only. Eg:

    $ nvm uninstall 16.16.0

    Code language: JavaScript (javascript)

    You should see an output like this:

    Uninstalled node v16.16.0

    Code language: JavaScript (javascript)

    Step 3: Removing NodeJS info from the Source Lists

    After removing NodeJS, check to see if there is any NodeJS data present in the /etc/apt/sources.list.d directory:

    $ ls /etc/apt/sources.list.d

    Code language: JavaScript (javascript)

    You should see folders named nodesource.list and nodesource.list.distUpgrade. If not present then your NodeJS information is removed from the sources list. Otherwise, Use the below command to remove them:

    $ rm -rf nodesource.list nodesource.list.distUpgrade

    Code language: JavaScript (javascript)

    Last but not the least, make sure to update the Ubuntu repositories.

    $ sudo apt-get update

    Code language: JavaScript (javascript)

    Step 4: Clearing the Cache

    NodeJS can sometimes leave traces of some packages and modules after uninstalling. You can use any of the following methods to remove all the node-related packages as well as the configuration files.

    Method 1: Using the purge command

    The purge command helps us remove all these packages and files. Use any of the two commands below:

    $ sudo apt-get purge nodejs

    Code language: JavaScript (javascript)

    or

    $ sudo apt-get purge – auto-remove nodejs

    Code language: JavaScript (javascript)

    Method 2: Removing npm manually

    You can manually remove the hidden npm directories and other related files using the below commands:

    $ ls -la $ rm -rf .npm

    Code language: JavaScript (javascript)

    Step 5: Remove Unused Files

    The last step is to run the following command to get rid of unused files and free up the space on your computer.

    $ sudo apt-get autoremove

    Code language: JavaScript (javascript)

    Uninstalling the Node.js on Mac

    Now, let’s look at some of the ways to uninstall Node.js from MacOS as well.

    Method 1: Uninstalling using homebrew

    • Click on the search icon in the menu bar or press command + space to launch the spotlight.
    • Type terminal and hit Return.
    • Run this command to uninstall all versions of Node from your mac.

    # brew uninstall --force node

    Code language: JavaScript (javascript)
    • Once that’s done, type the following command to remove unused folders and dependencies.

    # brew cleanup

    Code language: JavaScript (javascript)

    Method 2: Uninstalling using NVM

    • Click on the search icon in the menu bar or press command + space to launch the spotlight.
    • Type terminal and hit Return.
    • To uninstall the node with the help of nvm, type the following command, replacing <version> with the current version of your node installed. Eg: v16.16.0.

    # nvm uninstall <version>

    Code language: JavaScript (javascript)

    Method 3: Uninstalling using terminal

    • Click on the search icon in the menu bar or press command + space to launch the spotlight.
    • Type terminal and hit Return.
    • Once the terminal is opened, enter the given below command:

    # sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*}

    Code language: JavaScript (javascript)
    • The above command will not remove all of the packages. To delete every global package you have installed using npm, run the below command:

    # rm –rf ~/.npm

    Code language: JavaScript (javascript)

    Method 4: Uninstalling Node Manually

    • From the Dock, select the Go menu and then Folder from the Finder icon.
    • In the text box, paste the directory path: /usr/local/lib
    • Then move any files that have the name ‘node’ to the Trash.
    • Paste each of the following paths into the text box in Go to Folder and drag the files with the name ‘node’ to the Trash.

    /usr/local/bin /usr/local/include /usr/local/share/man/man1/ /usr/local/lib/dtrace/ /opt/local/bin/ /opt/local/include/ /opt/local/include/ /usr/local/share/doc/ /usr/local/share/systemtap/tapset/

    Code language: JavaScript (javascript)
    • Drag the following files in the Home folder to the Trash: .npm, .node-gyp, .nodereplhistory.
    • Lastly, empty the Trash.

    Conclusion

    That was pretty much it! Hopefully, you can now successfully uninstall NodeJS from your computer.

    If you ever feel lost and want help understanding where to start your coding journey then go check out Codedamn. There are amazing courses and blogs for web development and other coding concepts. Remember to practice coding on a daily basis. You can play around with your code on Codedamn’s online compiler as well

    Let us know in the comments if you have any suggestions or queries. Finally, If you are interested in my content and would like to connect, then you can find me on Linkedin or Twitter.

    Live New Year Sale. Become The Best Full-Stack Developer 🚀

    Get access to hunderes of practice Node.js courses, labs, and become employable full-stack web developer.

    • Free money-back guarantee
    • Unlimited access to all platform courses
    • 100’s of practice projects included
    • ChatGPT Based Instant AI Help
    • Structured Node.js Full-Stack Roadmap To Get A Job
    • Exclusive community for events, workshops

    Go Pro Now (50% Discount For Limited Time)

    Learn programming on codedamn

    Codedamn is an interactive coding platform with tons of sweet programming courses that can help you land your first coding job. Here’s how:

    • Step 1 — Create a free account
    • Step 2 — Browse the structured roadmaps (learning paths), or see all courses.
    • Step 3 — Practice coding for free on codedamn playgrounds.
    • Step 4 — Upgrade to a Pro membership account to unlock all courses and platforms.

    Programming is one of the most in-demand jobs today. Learning to program can change your future. All the best!

    In this tutorial, I will walk you through an easy step-by-step guide on how to uninstall Nodejs from Windows 10.

    Here are different ways to uninstall Nodejs from Windows 10.

    How to Check if Nodejs is Installed?

    Here are steps to check if you have Nodejs installed on your Windows machine.

    • Open File Explorer
    • Go to This PC from the left sidebar
    • Open C:/ drive
    • Or, simply navigate to the file path you had originally installed Nodejs and look there for the nodejs directory.
    • Otherwise, you can simply move to this file path: C:Program Filesnodejs

    The other locations where you should check if Nodejs or NPM related files and directories are installed on your Windows machine can be:

    • C:Program Files (x86)Nodejs
    • C:Program FilesNodejs
    • C:Users{User}AppDataRoamingnpm (or %appdata%npm)
    • C:Users{User}AppDataRoamingnpm-cache (or %appdata%npm-cache)
    • C:Users{User}.npmrc (make sure you look for the files or directories without the . prefix too)
    • C:Users{User}AppDataLocalTempnpm-*

    Via Command Prompt

    Another way to check if Nodejs is installed on your windows machine is to check it via Command Prompt in Windows.

    • Go to Start and search for Command Prompt
    • Or, simply press the Win key+R to open Run. Type cmd and hit Ctrl+Shift+enter to run Command Prompt as administrator.
    • Right click on the result and select Run as administrator
    • Now, pass this command:

    How to Uninstall Nodejs from Apps & Features Settings?

    Get started by following the below steps to uninstall Nodejs from Windows via the Apps & Features settings.

    • Click start button and go to settings by clicking the gear icon.
    • Click Apps.
    • Under the Apps & features subheading, look for a search box and search for Nodejs.
    • Click the Nodejs application.
    • Lastly, click Uninstall.
    • Check in the file path where you had installed Nodejs. The nodejs directory should now be gone.
    • You might be prompted to restart your Windows machine. Even if you are not, it is recommended you do it. Sometimes, it might take time to for changes to reflect.

    How to Uninstall Nodejs from Command Prompt?

    Follow the below-mentioned steps to uninstall Nodejs using Command Prompt in Windows 10.

    • Go to Start and search for Command Prompt
    • Or, simply press the Win key+R to open Run. Type cmd and hit Ctrl+Shift+enter to run Command Prompt as administrator.
    • Right click on the result and select Run as administrator
    • Now, pass this command:

    npm cache clean –force

    Make sure the command to uninstall Nodejs, is correct.

    • After deleting, make sure you check for the nodejs directory in your system whether it has been deleted or not.
    • You might be prompted to restart your Windows machine. Even if you are not, it is recommended you do it. Sometimes, it might take time to for changes to reflect.

    How to Uninstall Nodejs Using Registry Editor in Windows 10?

    Follow the below steps to uninstall nodejs using Registry Editor in your Windows 10 machine.

    • Open Start and search for Registry Editor and click the result. Or, simply press the Win key+R to open Run. Type regedit and hit enter.
    • You will be prompted by Windows saying “Do you want to allow this app to make changes?”. Click Yes.
    • Now, in the path field on top, simply paste this path:

    ComputerHKEY_LOCAL_MACHINESOFTWARENode.js

    • Next, on the sidebar on the left, you should now be able to see the Nodejs directory
    • Right click on it and click delete
    • Now, you will need to again check in the path where you originally installed Nodejs for the nodejs directory if it exists or not.
    • You might be prompted to restart your Windows machine. Even if you are not, it is recommended you do it. Sometimes, it might take time to for changes to reflect.

    How to Uninstall Nodejs Using Control Panel from Windows 10?

    Follow the methods below to uninstall Nodejs from Control Panel in Windows 10.

    • Open Start and search for Control Panel. Click the result.
    • Or, simply press the Win key+R to open Run. Type control and hit enter.
    • Click Programs
    • Under the Programs and Features option, click Uninstall a Program
    • Look for Nodejs and right click on it.
    • Now, click Uninstall.
    • You will be prompted by Control Panel by saying “Are you sure you want to uninstall Nodejs…”. Click Yes.
    • To make sure it is completely removed, check in the path where you originally installed Nodejs for the nodejs directory if it exists or not.
    • You might be prompted to restart your Windows machine. Even if you are not, it is recommended you do it. Sometimes, it might take time to for changes to reflect.

    How to Uninstall Nodejs Using .msi Installer in Windows 10

    Follow the steps demonstrated below to uninstall Nodejs using the .msi installer used for installing, repairing, and uninstalling Nodejs from Windows 10.

    • Open Start and search for .msi
    • Or, you can simply jump to the Downloads directory and look for the .msi file of Nodejs
    • If you do not find it there, look in the location where you installed the .msi installer for Nodejs
    • Click the Nodejs .msi installer file
    • You should now see a Nodejs setup open for you. Click Next
    • Click Remove
    • To make sure it is completely removed, check in the path where you originally installed Nodejs for the nodejs directory if it exists or not.
    • You might be prompted to restart your Windows machine. Even if you are not, it is recommended you do it. Sometimes, it might take time to for changes to reflect.

    Read More: How to Update NodeJS Version on Windows, Linux, and macOS

    Conclusion

    In this tutorial, I covered an easy step-by-step guide on how to uninstall Nodejs from Windows 10.

    Noteworthy References

    Stack Overflow

    Like this post? Please share to your friends:
  • How to delete efi partition from windows
  • How to delete cortana from windows 10
  • How to delete certificate windows 10
  • How to customize start menu windows 10
  • How to create windows cmd file