What Is Node-Gyp

Can anyone explain me what is node-gyp and why it uses my system files to build Node.JS packages.

  1. If Ii build a node project and it used node-gyp internally.
  2. Then I just tar that project and moved to a different system
  3. I untar it there and try to use it

Will this approach work?

4

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:

10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest