nodejs / node-gyp

Node.js native addon build tool
MIT License
9.88k stars 1.79k forks source link

Header problem when porting old code. #782

Closed jcvernaleo closed 8 years ago

jcvernaleo commented 8 years ago

I have some legacy code that I'm trying to port to the latest node and I seem to be hitting an issue related to node-gyp. I'm running on Ubuntu 15.04. I'm using node installed from nvm (no other node on the system):

jcv@yoshi ~ $ nvm use v4.2.1
Now using node v4.2.1 (npm v3.3.8)
jcv@yoshi ~ $ node-gyp -v
v3.0.3

My code builds fine with node v0.10.40 but nothing newer. With node4.2.1 when I run node-gyp rebuild I get:

/home/jcv/.node-gyp/4.2.1/include/node/node_internals.h:5:18: fatal error: util.h: No such file or directory
 #include "util.h"

My code needs to include node_internals.h but based on that error I don't see how something with node_internals.h can compile. ~/.node-gyp/4.2.1/include/node/ does not have util.h or util-inl.h Is there something I'm missing? Some package (system or node)? Or some step I don't understand. Any ideas would be greatly appreciated.

bnoordhuis commented 8 years ago

Sorry, you're on your own. You shouldn't be including node_internals.h in your project. Only node.h, node_buffer.h and node_object_wrap.h are considered "public" headers.