nwjs / nw-gyp

native addon build tool for node-webkit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nw-gyp build error

RichardFoss opened this issue · comments

I got the error output shown below when I tried to build the npm cap module (Mac). I see that I do have the makefile.

Is it correct that If I use an LTS version of node.js, I will not need to use nw-gyp? The latest LTS version is 8.12. What would be the appropriate nwjs to use with this?


RU02ATMH:cap csrf$ nw-gyp build
gyp info it worked if it ends with ok
gyp info using nw-gyp@3.6.3
gyp info using node@10.12.0 | darwin | x64
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack TypeError: Invalid Version: undefined
gyp ERR! stack at new SemVer (/usr/local/lib/node_modules/nw-gyp/node_modules/semver/semver.js:279:11)
gyp ERR! stack at compare (/usr/local/lib/node_modules/nw-gyp/node_modules/semver/semver.js:566:10)
gyp ERR! stack at Function.gt (/usr/local/lib/node_modules/nw-gyp/node_modules/semver/semver.js:595:10)
gyp ERR! stack at /usr/local/lib/node_modules/nw-gyp/lib/build.js:64:22
gyp ERR! stack at /usr/local/lib/node_modules/nw-gyp/node_modules/graceful-fs/graceful-fs.js:78:16
gyp ERR! stack at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/nw-gyp" "build"
gyp ERR! cwd /Users/csrf/Documents/Immergo/ImmergoCode-SPK4-18-10-07/node_modules/cap
gyp ERR! node -v v10.12.0
gyp ERR! nw-gyp -v v3.6.3
gyp ERR! This is a bug in nw-gyp.
gyp ERR! Try to update nw-gyp and file an Issue if it does not help:
gyp ERR! https://github.com/nwjs/nw-gyp/issues

I encountered the same issue before.
A workaround I found is changing the command from nw-gyp rebuild into nw-gyp rebuild --target=x.xx.x --arch=x64

Thanks for the help, and apologies for the slow reply. I had moved on and used the latest LTS version of node.js - I did not need to use nw-gyp. I will certainly bear this in mind, thank you!