Can anyone explain me what is node-gyp and why it uses my system files to build Node.JS packages.
- If Ii build a node project and it used
node-gypinternally. - Then I just tar that project and moved to a different system
- I untar it there and try to use it
Will this approach work?
1 Answer
node-gyp is a tool which compiles Node.js Addons. Node.js Addons are native Node.js Modules, written in C or C++, which therefore need to be compiled on your machine. After they are compiled with tools like node-gyp, their functionality can be accessed via require(), just as any other Node.js Module.
If you do what you suggested the module won't work, you will need to compile it/build it with node-gyp on the system you moved the program to.
node-gyp:
Node.js Addons: