What is node-gyp

node.jsNode Gyp

node.js Problem Overview


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?

node.js Solutions


Solution 1 - node.js

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: https://github.com/nodejs/node-gyp

Node.js Addons: https://nodejs.org/api/addons.html

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionselftaught91View Question on Stackoverflow
Solution 1 - node.jsvuzaView Answer on Stackoverflow