Reputation: 8201
I am facing challenges while creating package for all the clientside components of my project in a system which does not have internet connection (for windows).
I have installed NPM for windows in the system. I need to manage the node_modules
and run gulp commands in the system to create the package.
Since there is no internet connection in the box, I decided to copy the node_modules
from my local box to the box which does not have internet connection.
For copy task, I am using msbuild
script but somehow it is not working for me. Also, I see that when I am trying to copy the node_modules
manual from one folder to another folder I am unable to copy.
Installed Node version : v0.12.2 NPM version: 2.7.4
Can anyone help me to provide any working sample to fix the above problem.
Upvotes: 4
Views: 6032
Reputation: 7736
I think your approach is generally sound. You can build on the internet connected computer no problem! Copy files over with a usb stick if you like.
Here are some tips that might help solve your problems.
Otherwise you need to run the local directory install of gulp. e.g.
node node_modules\gulp\bin\gulp.js build
because you won't be able to npm install -g gulp
Point 3 will work for other global npm_modules too btw
If you are facing long paths (> 256 characters) which can cause copy problems
npm dedupe
to remove duplicatesc:\proj
instead of to c:\very\long\path\proj
Or explicity install a dependency which has a long path
e.g
npm install [email protected]
and then prune that folder from the original
rm node_modules\package\node_modules\package_with_too_many_nested_folders
Or Install the latest npm (v3.0 or higher) which solves this issue once and for all
e.g. npm install -g npm
which will build a much flatter hierarchy for your packages. Requires removing and reinstalling all packages.
Point 5 is a notorious issue on windows which is not a problem on linux because paths can be extremely long. (unless you are mounting a windows a windows directory from linux)
Personally I would go straight for the latest npm version but you have a number of ways of getting around the issue if this is not possible.
Upvotes: 2