How to uninstall Angular, Node and NPM from Windows 11

How to remove Angular CLI from Windows 11:

Currently we have installed and old version of Angular and I would like to delete completely that version from my Windows 11

The first thing that we will do is to open a Windows Power Shell console to check which old version of Angular CLI I’m using, for that I will use the command: ng version

The next step to uninstall Angular CLI is to run the command

Uninstall Angular CLI: npm uninstall -g @angular/cli

Note: in the command -g means “Global”, we are uninstalling the global version of Angular CLI in our system

Clear Cache:
npm cache clean –force
npm cache verify

Check Angular version
ng version

  Now looks like Angular has been uninstalled, but we need to check that all unused folders and paths has been deleted from Windows 11 operating system  

Checking if the global Angular path still in Windows Environment Variables
We can see that angular is not there


To be 100% sure that Angular was uninstalled, we need to delete hidden folder in Windows 11, by follow:

  • Go to the older “This PC” in Windows`
  • In the navigation bar select my current user
  • Go to your user (in my case is Yoan) and show the hidden folders

  • Show my hidden item and look for AppData forlder
  • Now delete a folder called @angular that is located in this path:
    “Your user”> AppData > Roaming > npm > node_module >

To reinstall Angular CLI we can use this command:
npm install -g @angular/cli

IMPORTANT NOTE: in our case, we will not reinstall Angular until node.js and npm are completely uninstalled and installed again. The reason is simple, we want to have fresh installation of Angular with a compatible version of node.js and npm

How to remove Node.js from Windows 11:


Checking which node version, by running this command: node -v
Checking which npm version, by running this command: npm -v
Run: npm cache clean –force

Uninstall from Programs & Features with the uninstaller

Reboot (or you probably can get away with killing all node-related processes from Task Manager).

Check again the node version in your power shell console. Now we can see that node has been deleted but we still need to manually delete the unused folders from Windows 11  

Look for these folders and remove them (and their contents) if any still exist. Depending on the version you installed, UAC settings, and CPU architecture, these may or may not exist:

C:\Program Files (x86)\Nodejs -> In my case was deleted by the uninstall windows program
C:\Program Files\Nodejs
C:\Users{User}\AppData\Roaming\npm (or %appdata%\npm) -> ok, founded and deleted

C:\Users{User}\AppData\Roaming\npm-cache (or %appdata%\npm-cache)  In my case nothing there
C:\Users{User}.npmrc (and possibly check for that without the . prefix too)  In my case nothing there
C:\Users{User}\AppData\Local\Temp\npm-* -> In my case nothing there

Checking our %PATH% environment variable to ensure no references to Nodejs or npm exist.
We can see that node and npm were deleted


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *