简体   繁体   中英

node-gyp build how to specify target node version while building node extension

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.

The solution is to specify --target argument while configuring using node-gyp. for ex.

node-gyp --arch=<WHATEVER> --target=v0.8.20 configure

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM