Muhammad Ahsan
Muhammad Ahsan

Reputation: 1954

How to add your package.json dependencies from node_modules folder?

I was working on a project and i accidentally deleted my package.json file then i again used npm init command to create new one but i already had a lot of gulp extensions in my node_modules...

So now how can i add those dependencies again back to my new package.json file

How can a package.json file be get list of dependencies from my node_modules folder?

Upvotes: 2

Views: 1012

Answers (1)

prasun
prasun

Reputation: 7343

you can alternatively list all installed dependencies using:

npm list --depth=0

and then manually add them to your package.json file

if you want to get globally installed packages, use

npm list -g --depth=0

Upvotes: 3

Related Questions