简体   繁体   中英

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

I am new to angular and 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". 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. Any help you can provide would be appreciated.

npm clean

npm cache clean

Or

you can delete the local node modules folder to zip wherein package json would be helper for same other folks.

Thanks to my colleague I have managed to do it easily using rimraf :

  1. Execute this command: npm install -g rimraf inside your angular project
  2. Then execute: rimraf node_modules inside your angular project (NOTE: node_modules is the name of directory that contains node modules)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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