简体   繁体   English

如何清理 Angular 2+ 项目,以便可以将其压缩并通过电子邮件发送

[英]How do I clean an angular 2+ project so it can be zipped and emailed

I am new to angular and npm.我是 angular 和 npm 的新手。 I have a project I have been working on and would like to zip and email it.我有一个我一直在从事的项目,想将其压缩并通过电子邮件发送。 Is there an npm command to leave packages.json and clean the node-modules directory so that someone who gets the zip can unzip and run "npm install".是否有 npm 命令离开 packages.json 并清理 node-modules 目录,以便获得 zip 的人可以解压缩并运行“npm install”。 Or is this just something you need to do from command line and remove all child directories under node-modules?或者这只是您需要从命令行执行并删除节点模块下的所有子目录的事情?

I think the only directory I need to clean is node_modules is that correct.我认为我需要清理的唯一目录是 node_modules 是正确的。 Any help you can provide would be appreciated.您能提供的任何帮助将不胜感激。

npm clean npm 干净

npm cache clean npm 缓存清理

Or或者

you can delete the local node modules folder to zip wherein package json would be helper for same other folks.您可以删除本地节点模块文件夹以进行压缩,其中包 json 将成为其他人的帮手。

Thanks to my colleague I have managed to do it easily using rimraf :感谢我的同事,我设法使用rimraf轻松做到了

  1. Execute this command: npm install -g rimraf inside your angular project在 angular 项目中执行此命令: npm install -g rimraf
  2. Then execute: rimraf node_modules inside your angular project (NOTE: node_modules is the name of directory that contains node modules)然后在你的 angular 项目中执行: rimraf node_modules (注意:node_modules 是包含节点模块的目录的名称)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM