I would like to know if there is a command available in npm, that can give me the node version used to build the c++ addons of a project.
I noticed that there is a build folder in the c++ module after running npm build or npm rebuild containing a file config.gypi which contains the node version used to build the addon, it is so possible to retrieve the node version from there but for me it will be handy to have a npm command to get the version.
Is this still a problem for you?
I'm afraid that there is no such npm command, and there probably won't be one. Managing the C/C++ build steps belongs to a separate tool called node-gyp which npm knows how to run, but doesn't know about the internals of.
However, the config.gypi files are a one-line comment followed by a JSON object and have a regular structure, so you could either write a small node program to parse them, or use something cruder like this:
$ find . -name config.gypi | xargs grep 'node_version'
./node_modules/ws/build/config.gypi: "node_version": "0.10.33",
We are trying to clean up older npm issues, so if we don't hear back from you within a week, we will close this issue. (Don't worry -- you can always come back again and re-open it!)
Thanks @othiym23, that's not an issue for me anymore, thanks for the workaround you suggested.