How To Remove Unused Dependencies In React?

Forums ReactHow To Remove Unused Dependencies In React?
Staff asked 3 years ago

Answers (1)

Add Answer
Hardik Ghevariya Marked As Accepted
Staff answered 3 years 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

npm-check

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

Example:

npm uninstall react-router

this will remove react-router from your app.

Thank u @Hardik Ghevariya it’s working.

Jaydip Mali replied 3 years ago

Subscribe

Select Categories