I have installed webpack in this way:
npm install -g webpack
Now want to uninstall it:
npm uninstall -g webpack
You have to remove the packages manually installed globally on your os with sudo:
On OsX navigate to this directory
cd /usr/local/lib/node_modules
and
sudo rm -rf <packageName> // sudo rm -rf webpack
You're most likely running a file from another install of npm.
Run which webpack
to see where your shell is finding webpack.
Run npm root -g
to find the root of the tree it's supposed to be in, being sure you're running the correct npm with npm -v
and which npm
.
If your webpack bin isn't in the npm root, reset your path to the webpack binary e.g. hash -d webpack
in bash, and then go remove the unwanted npm root from your PATH variable. You can now use npm install -g webpack
and npm uninstall -g webpack
and it should work.
Try running both the below:
npm uninstall -g webpack
npm uninstall webpack
I think you might be checking/lloking at the local version after deleting only the global one.
Try
chown -R "$(whoami)": "$(npm root -g)"
(you may need sudo for it) and then npm uninstall -g again
npm uninstall -g webpack
Worked for me, try running the command prompt in administrator mode.