How To Remove Unused Dependencies In React?

Forums ReactHow To Remove Unused Dependencies In React?
Staff asked 9 months ago

Answers (1)

Add Answer
Hardik Ghevariya Marked As Accepted
Staff answered 9 months ago

First, we need to install npm-check in your app using the following command

(Make sure to run cmd as an administrator and also  make sure that this folder contains the package.json file, otherwise, this will not work)

npm install -g npm-check

After completion, run the below command


this command will check all of your packages and check whether the package is outdated, incorrect, or unused and gives a list

To remove the particular package from your app execute the following command


npm uninstall react-router

this will remove react-router from your app.

Thank u @Hardik Ghevariya it’s working.

Jaydip Mali replied 9 months ago


Select Categories