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

StackOverflow https://stackoverflow.com/questions/15964427

  •  03-04-2022
  •  | 
  •  

Frage

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.

War es hilfreich?

Lösung

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

node-gyp --arch=<WHATEVER> --target=v0.8.20 configure
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top