简体   繁体   中英

Should I upload “node_modules”?

I am making a web page, node_modules file is around 150 megabytes, should I upload it or not? Is there any way to make it smaller? I am using "filezilla" and it would take too long to upload it.

Node modules is where all the external libraries you use for your application are kept. The list of those libraries should be mentioned in package.json file.

You should, typically, not upload node modules folder manually. They are the external libraries and are easily available to install separately. So, when moving files through filezilla, move everything but node modules. Then, in your server, simple run npm i before running the application.

If you have a package.json file and used npm module -s <package_name> (with -s or --save) then everything was fine.

If you don't have it no worries.Transfer the files into your online services like AWS,Something like that.

Then give the commands.

// For install npm

  npm i
    (or) 
  npm install

// To start your server

  npm start 

Whatever you put in your package.json file Start Object the file will be triggered.

No need to copy the node_modules folder at all.

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