3

I'm trying to uninstall a globally installed NPM package named commitizen.

I have tried executing the command below, however; the command fails to return any results.

  npm uninstall -g commitizen

up to date in 0.035s

I restarted the machine.

To check whether or not the package was removed I tried running commitizen. I expected an error, as it should have been removed. To my surprise the package executed.

commitizen

The result of npm list -g --depth 0 or npm list -g commitizen:

npm list -g --depth 0 or npm list -g commitizen

The result of npm list -g commitizen:

npm list -g commitizen

The result of cd /usr/local/lin/node_modules

cd /usr/local/lin/node_modules

So the question is what is the right approach of globally deleting the npm package?

JΛYDΞV
  • 8,532
  • 3
  • 51
  • 77
Zameer Ansari
  • 28,977
  • 24
  • 140
  • 219

2 Answers2

1

One way to check would be running npm list -g --depth 0 or npm list -g commitizen

If you want to check the package locally, head to /usr/local/lin/node_modules

Jiri Kralovec
  • 1,487
  • 1
  • 10
  • 18
1

Uninstalling global packages might answer this question:

"So the question is what is the right approach of globally deleting the npm package?"


In addition, I had a similar problem on windows 10. I solve it just by upgrading npm to the latest version.

Make sure it works with npm ls -g --depth=0 or npm list -g commitizen.

If that still doesn't work try to running npm uninstall -g commitizen one more time.

Kevin
  • 403
  • 9
  • 22