Question

I need to copy a Node.JS project to a computer that will not be connected to the internet. Yes, I know that NPM can create a TarBall, but that is really not appropriate here:

  1. It is a windows box
  2. It has limited storage

I was wondering if I could just do a recursive copy of all the .js files in node_modules [NOTE, my node project is very clean, it does not include any .dll or native system access stuff]

E.g.

robocopy $source/node_modules $dest/node_modules /S /NFL /TEE /LOG:watson.log /MT:16 *.js *.json *.types

which uses 16 threads in RoboCopy to do a full tree copy

#robocopy swtiches /S = subdirs, /ETA = estimates, /NFL = don't list files, /MT = number of parallel tasks, /TEE show log on console
#robocopy switches /xd directory exclude /xf file exclude
Was it helpful?

Solution

I found this is working for me. But then, I did not need any fancy dependencies (e.g. DLL files). Works fine at removing lots of stuff in the packages I do not need.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top