felixrieseberg/npm-windows-upgrade

Automate "Cleaning" of an attempted upgrade

Opened this issue · 0 comments

@robertbaker wrote a great summary of what's required after someone attempted to upgrade npm with npm install npm or npm upgrade npm. We should offer an automation of the cleanup steps, probably using PowerShell, executed from the script npm-windows-upgrade --fix-attempted-upgrade.

The steps:

Uninstall nodejs, not repair!, UNINSTALL.
Go into %programfiles%\nodejs and delete the entire folder.
Delete %appdata%\npm and %appdata%\npm-cache
Edit your PATH and remove everything that references npm (either program files or appdata).

At this point you should have a blank slate. No node packages, no node in your path, nothing.

So then install the latest node from nodejs.org.

Then in powershell as an admin run npm i -g npm-windows-upgrade
then run npm-windows-upgrade
then update to latest npm.