- Delete node js and npm windows
- How to install/uninstall Node.js and npm on Microsoft Windows
- Installing using Windows Installer
- 1) Download Windows Installer
- 2) Run the downloaded Windows Installer
- Installing using Windows binary(zip) file
- 1) Download Windows binary(zip) file
- 2) Extract the zip file
- Test/Validate Installation
- Hello World Sample
- Uninstall Node.js and npm
- Uninstall node.js and npm installed using Windows Installer (msi)
- Uninstall node.js and npm installed using Windows Binary (zip)
- Cleanup directories
- Лучший путь как переустановить Node.Js (Mac/Linux/Windows)
- How to completely remove node.js from Windows
- 8 Answers 8
- How do I uninstall a package installed using npm link?
- 5 Answers 5
- npm link pain:
- Option 1: Unlink via npm:
- Option 2: Remove the symlink like a normal linux guru
Delete node js and npm windows
We can completely remove Node.js from windows using the following simple steps:
Step 1: Whenever we install a package with command npm install
, 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.
Step 2: After that, you can verify the cache by using the below command:
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 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\
\AppData\Roaming\npm or open run and type appdata and click ok and open roaming there you will find npm. - C:\Users\
\AppData\Roaming\npm-cache or open run and type appdata and click ok and open roaming there you will find npm-cache. - C:\Users\
\.npmrc - C:\Users\
\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:
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.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
How to install/uninstall Node.js and npm on Microsoft Windows
This tutorial shows how to install and uninstall Node.js and npm on Microsoft Windows.
Installing Node.js and npm is very easy and straight forward using the Windows Installer or Windows binary(zip) file from the node.js web site
Installing using Windows Installer
1) Download Windows Installer
Download the latest Windows Installer(.msi) from node.js web site.
2) Run the downloaded Windows Installer
Run the Installer(.msi) and follow the prompts to review the installation setting (you can accept all default values) and click on install to install both node.js and npm.
Once you click on install, installer installs nodes.js and npm in the specified directory
Installing using Windows binary(zip) file
1) Download Windows binary(zip) file
Download the latest Windows binary(zip) file from node.js web site.
2) Extract the zip file
Extract the downloaded zip file to any directory (example c:/node) where you want to install the node.js and npm. Thats it, installation done!
Add extract directory to windows PATH environment variable (example PATH=c:/node;%PATH)
Test/Validate Installation
To test if Node.js is installed, Open up a new Windows Console and the run the following command at the Windows command prompt. This will print the installed node.js version
node -v
You should see output like this
To test if npm is installed, Open up a new Windows Console and the run the following command at the Windows command prompt. This will print the installed npm version
npm -v
You should see output like this
Hello World Sample
To test if every thing working fine, create a small helloWorld.js script with some javascript commands and run it as «node HelloWorld.js» from the windows command prompt
You should get output like below if you run from the command prompt
Uninstall Node.js and npm
Uninstall node.js and npm installed using Windows Installer (msi)
To uninstall node.js and npm, Open Windows «Control Panel» -> «Uninstall a program», select Node.js and click on uninstall to uninstaill both node.js and npm
Uninstall node.js and npm installed using Windows Binary (zip)
Delete the extracted directory
Cleanup directories
After the uninstall, look for the following folders and delete them if exists
* Nodejs installed directory
* npm and npm-cache directories from %appdata% directory
* npmrc directory from user home directory ( C:\Users\
Лучший путь как переустановить Node.Js (Mac/Linux/Windows)
Один из простейших путей как установить Node.Js это пойти на официальный сайт, скачать установочный файл и установить его. Позже разработчики столкнулись с ситуацией, когда им нужно сменить версию Node.js на другую или обновить текущую версию.
Это все еще возможно — установить другую версию с официального сайта, но как много нод уже установлено в системе?
Может быть это хорошее время для удаления их всех и настроить возможность системе переключаться между нодами за секунды, всегда зная количество установленных версий и иметь возможность удалить любые из них одной простой командой.
Обо всем по порядку, мы должны удалить старые версии ноды и все связанное с этим. Вы счастливчик, если вы установили прошлые версии с помощью Homebrew. Метод Homebrew это один из простейших вариантов для установки и удаления ноды на маке.
Напишите эту команду в терминале. Brew удалит все установленные версии Node.Js
После этого, лучше всего, запустить brew cleanup, это удалит все неиспользуемые зависимости и папки.
Если ваша Node.js была установлена по другому, это не проблема. Вы можете удалить вручную. Есть куча папок, они могут быть удалены одна за одной через файндер или терминал.
Список папок, где находятся Node.js и npm
- node и/или node_modules в папке /usr/local/lib
- node и/или node_modules в папке /usr/local/include
- node, node-debug, и node-gyp в /usr/local/bin
- .npmrc в вашей домашней директории ( Это настройки npm, не удаляйте этот файл, если хотите далее переустановить Node.js )
- .npm в вашей домашней директории
- .node-gyp в вашей домашней директории
- .node_repl_history в вашей домашней директории
- node* в /usr/local/share/man/man1/
- npm* в /usr/local/share/man/man1/
- node.d в /usr/local/lib/dtrace/
- node в /opt/local/bin/
- node в /opt/local/include /
- node_modules в /opt/local/lib/
- node в /usr/local/share/doc/
- node.stp в /usr/local/share/systemtap/tapset/
В случае, если вы не хотите вручную искать и удалять все эти папки и файлы, вы можете ввести одну простую команду в терминал:
Эта команда не трогает вашу домашнюю директорию, так что в дальнейшем вы можете сами решить, что делать с сохранившимися файлами.
Сейчас мы можем удалить все глобальные пакеты, установленные с npm
После всех этих команд, Node.js и npm будут полностью удалены с вашего компьютера.
После очистки, мы можем продолжить с установкой новой версии Node.js. Но мы сделаем это не прямым путем. Потому что если мы сделаем это по обычному, мы все еще будем иметь ту же проблему с кучей версий в будущем.
Для решения этой проблемы, мы должны установить дополнительную маленький скрипт: NVM
У данного скрипта есть единственная зависимость — установленная Command Line Tools. Если у вас все еще это не установлено, вы должны запустит команду в терминале:
Итак, мы готовы установить NVM. Простейший путь это сделать — .sh скрипт.
Скачать и установить данный скрипт мы можем с помощью следующей команды:
0.37.2 — последняя версия на день написания статьи. Версия может быть проверена на странице NVM в GitHub
Конечно, это может быть установлено вручную. Вы нужно склонировать репозиторий и добавить необходимы файлы в PATH. Детальная инструкция описана в NVM ReadMe. Это будет полезно если вам нужно использовать NVM в CI пайплайн. Я бы рекомендовал добавить NVM в Docker image, который использует ваш пайплайн.
Не забудьте перезапустить окно терминала для обновления переменных окружения
Мы почти закончили. Сейчас мы легко можем установить любую версию Node.js. Для примера, эта команда установит самую свежую версию:
Если вы хотите установит LTS версию, но с последней версией npm, сделайте следующее:
Используя флаги, вроде —lts вы можете использовать любую версию.
Для того, что бы увидеть список установленных версий, вам нужно запустить команду:
После установки, вам нужно выбрать дефолтную версию для вашей системы:
How to completely remove node.js from 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 running v0.8.11. Obviously, some stuff was left behind during the uninstall process, and it’s causing me to have all sorts of errors when trying to add modules through npm. I’ve seen solutions to this for OSX and Linux, but couldn’t find anything for Windows. I’m running Windows 7 64-bit.
8 Answers 8
###How to remove Node.js from Windows:
Take a deep breath.
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).
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:
Check your %PATH% environment variable to ensure no references to Nodejs or npm exist.
If it’s still not uninstalled, type where node at the command prompt and you’ll see where it resides — delete that (and probably the parent directory) too.
Reboot, for good measure.
100 MB. – Spooky May 6 ’14 at 20:01
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.
How do I uninstall a package installed using npm link?
When installing a node package using sudo npm link in the package’s directory, how can I uninstall the package once I’m done with development?
npm link installs the package as a symbolic link in the system’s global package location (‘/usr/local/lib`). This allows you to test the package while still developing it, without having to install it over and over again.
Which npm command do I need to run to remove the link again?
5 Answers 5
The package can be uninstalled using the same uninstall or rm command that can be used for removing installed packages. The only thing to keep in mind is that the link needs to be uninstalled globally — the —global flag needs to be provided.
In order to uninstall the globally linked foo package, the following command can be used (using sudo if necessary, depending on your setup and permissions)
This will uninstall the package.
To check whether a package is installed, the npm ls command can be used:
you can use unlink to remove the symlink.
To reinstall from your package.json:
npm link pain:
-Module name gulp-task
-Project name project-x
You want to link gulp-task:
1: Go to the gulp-task directory then do npm link this will symlink the project to your global modules
2: Go to your project project-x then do npm install make sure to remove the current node_modules directory
Now you want to remove this madness and use the real gulp-task, we have two options:
Option 1: Unlink via npm:
1: Go to your project and do npm unlink gulp-task this will remove the linked installed module
2: Go to the gulp-task directory and do npm unlink to remove symlink. Notice we didn’t use the name of the module
What if this didn’t work, verify by locating your global installed module. My are location ls -la /usr/local/lib/node_modules/ if you are using nvm it will be a different path
Option 2: Remove the symlink like a normal linux guru
1: locate your global dependencies cd /usr/local/lib/node_modules/
2: removing symlink is simply using the rm command
rm gulp-task make sure you don’t have / at the end
rm gulp-task/ is wrong 🔥🚨