laravel 删除我的项目中的 node_modules 目录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42737450/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Removing node_modules directory in my project
提问by TheBAST
What is the right way of removing the entire node_modules directory. Do i have to delete it right away
删除整个 node_modules 目录的正确方法是什么。我是否必须立即删除它
回答by upful
Ultimately you will need the modules for the application to work (if they are not development dependencies)...
最终,您将需要应用程序的模块才能工作(如果它们不是开发依赖项)...
If you want to erase modules you installed for development and not required in production then you can use npm prune
.
如果您想删除为开发安装而在生产中不需要的模块,那么您可以使用npm prune
.
Also, if you're using git you can add /node_modules
to the .gitignore
file, so you aren't saving libraries to your repo, and then later you can install dependencies by running npm install
.
此外,如果您使用的是 git,您可以添加/node_modules
到.gitignore
文件中,这样您就不会将库保存到您的存储库中,然后您可以通过运行 .gitignore 来安装依赖项npm install
。
回答by Goran_Ilic_Ilke
Best way which i found,in root of app from cmd rmdir /S node_modules
and thats it.
我找到的最好方法,在 cmd 的应用程序根目录中rmdir /S node_modules
,就是这样。
回答by Jayakusuma
i lost count on how many times i deleted node_modules just by pressing delete button. Had no problem so far, as long as you don't forget to
我不知道我只按删除按钮删除了多少次 node_modules。到目前为止没有问题,只要你不要忘记
npm install
everytime you delete node_modules to install dependency that is required by your app.
每次删除 node_modules 以安装应用程序所需的依赖项时。