[英]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... 我正在一个项目上, 不小心删除了package.json文件,然后再次使用npm init命令创建了一个新文件,但是我的node_modules中已经有很多gulp扩展了...
So now how can i add those dependencies again back to my new package.json file 所以现在我该如何再次将这些依赖项添加回我的新package.json文件中
How can a package.json file be get list of dependencies from my node_modules folder? 如何从我的node_modules文件夹获取package.json文件的依赖项列表?
you can alternatively list all installed dependencies using: 您也可以使用以下方法列出所有已安装的依赖项:
npm list --depth=0
and then manually add them to your package.json file 然后手动将它们添加到package.json文件中
if you want to get globally installed packages, use 如果要获取全局安装的软件包,请使用
npm list -g --depth=0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.