visizky
visizky

Reputation: 761

I deleted a package folder under node_modules by mistake

I deleted a folder under node_modules by mistake, should I run npm install in the project root to recover the deleted files without deleting the entire node_modules folder or should i delete the node_modules first and then run npm i?

If I run npm install without deleting the node_modules folder; will npm install only add the missing package files under the node_modules?

Upvotes: 0

Views: 495

Answers (1)

Abhishek Bhagate
Abhishek Bhagate

Reputation: 5766

You probably must be having package.json present in your project root directory. If you have so, then you can then directly run npm install and all the packages and dependencies will be restored.

Upvotes: 1

Related Questions