How to move npm node_modules cross platform folder?

I have a very special requirement from my client. We used npm to install karma and phantomjs for quite some time. Everything works fine until we move everything from the cloud to the internal infrastructure. Now things get complicated. The internal infrastructure does not have Internet access, so we can no longer use npm to resolve dependencies. We tried to move the node_modules folder dev machine to the internal infrastructure. This did not work, because the dev machine is OSX and Windows, and the server is Centos, and phantomjs is for the OS, but npm can work with the version. What parameters should we allow dependencies? I just find out that the name node_modules cannot be changed. I was thinking of checking in the node_modules OS, but this will not work, since npm only searches for the node_modules folder.

I got the same error as this PhantomJS Crash thread - Exit Code 126 when I tried to use node_modules from OSX on Centos.

+4
source share
2 answers

Install all the dependencies on the first OS (e.g. OSX), assuming you have package.json with all the dependencies.

npm install

Rename created npm_modules to npm_modules_mac

Repeat the steps above for different OSs (e.g. Windows), rename node_modules to something like node_modules_windows .

, , , (node_modules), (npm_modules → npm_modules_mac OSX)

+3

? .

defacto - @isaacs npmjs.org. :

https://github.com/isaacs/npmjs.org

CouchDB , . , . , reggie:

https://github.com/mbrevoort/node-reggie

0

All Articles