What is node-gyp

做~自己de王妃 提交于 2019-12-03 02:59:35

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/39739626/what-is-node-gyp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!