Как удалить node и npm windows

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.

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.

In this post, we’ll learn how to uninstall Node and NPM on Windows.

The first thing you should do is clear your NPM cache. This is a good idea to do before you uninstall Node as it will remove any information that Node has cached about your dependencies.

To clear your NPM cache, run the following command:

	npm cache clean --force

From there, go to your Control Panel. You can do this by searching for Control Panel in the search bar.

Once there, select the Programs and Features option.

Then, find and select Node.js and click the Uninstall button.

This will begin the uninstallation process.

After this has finished, restart you computer so the changes can take effect.

Once you’ve restarted your computer, you should be able to run the following command to confirm that Node and NPM have been uninstalled:

	node -v
npm -v

If your system cannot recognize or find these commands, then it means you’ve successfully uninstalled Node and NPM on your Windows system.

Manual Removal

If after running the above commands, you still see the Node and NPM commands return a valid version, then might need to manually remove them.

To do so, remove everything in the following directories:

	C:\Program Files (x86)\Nodejs
C:\Program Files\Nodejs
C:\Users\{Username}\AppData\Roaming\npm
C:\Users\{Username}\AppData\Roaming\npm-cache

Or if you prefer to use the %appdata% environment variable, you can use these directories:

	C:\Program Files (x86)\Nodejs
C:\Program Files\Nodejs
%appdata%\npm
%appdata%\npm-cache

Once again, restart your computer so the changes can take effect.

Conclusion

We’ve seen how to uninstall Node and NPM on Windows.

Hopefully, you able to complete these steps successfully and uninstall Node and NPM from your Windows system!

If you want to learn about web development, founding a start-up, bootstrapping a SaaS, and more, follow me on Twitter! You can also join the conversation over at our official Discord!

  • Support Us

  • Join

  • Share

  • Tweet

  • Share

Give feedback on this page!

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!

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.

Become The Best Full-Stack Developer 🚀

Codedamn is the best place to become a proficient 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+ practice projects included

ChatGPT Based Instant AI Help (Jarvis)

Structured Node.js Full-Stack Roadmap To Get A Job

Exclusive community for events, workshops

Start Learning

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 Files\Nodejs
  • C:\Users\{User}\AppData\Roaming\npm or open run and type appdata and click ok and open roaming there you will find npm.
  • C:\Users\{User}\AppData\Roaming\npm-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}\AppData\Local\Temp\npm-*                       

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.

Last Updated :
19 May, 2022

Like Article

Save Article

  • Как удалить nginx в windows
  • Как удалить pin windows 11
  • Как удалить nextrp launcher на windows
  • Как удалить physx на windows
  • Как удалить nero с windows 10