Home > Blockchain >  how to uninstall a dependency in node/react using npm
how to uninstall a dependency in node/react using npm

Time:03-13

I just installed nanoid dependency on my react-app using npm i nanoid. But I want to remove it.

I tried: npm uninstall nanoid but it doesn't remove it.

It's still inside node_modules directory.

How can I remove it using npm?

CodePudding user response:

Here are the steps:

  1. uninstall the package
  2. remove node modules
  3. npm i

CodePudding user response:

This is a workaround. delete node_modules folder, remove nanoid from package.json. then init again.

  • Related