I am migrating from node-waf build to node-gyp build system for node native addons. node-gyp says it supports multiple target version, but I couldn't find how to specify target node version while using node-gyp.
Problem is, my system has node v0.10.3 installed, but I need to build my native addon for node version 0.8.20. When I build the add-on it uses the headers for v0.10.3, which ofcourse gives errors.
I can't find how can I specify the node version while configuring / building using node-gyp.
Please help.
Or if you want a specific version like I needed 8.0. 0 then you can do this using. node -v. If you want to switch to the different version of Node, just type n in the terminal and you should see the Node versions listed.
node-gyp requires that you have installed a compatible version of Python, one of: v3. 7, v3. 8, v3. 9, or v3.
gyp file describes the configuration to build your module, in a JSON-like format. This file gets placed in the root of your package, alongside package. json .
node-gyp is a tool that enables the compilation of native add-on modules for Node in multiple platforms. It has widespread use and is included as a dependency in many NPM packages. On most systems, this isn't an issue, and installing node-gyp with the rest of your packages works as expected.
The solution is to specify --target argument while configuring using node-gyp. for ex.
node-gyp --arch=<WHATEVER> --target=v0.8.20 configure
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With