nwjs / nw-gyp

native addon build tool for node-webkit
MIT License
195 stars 46 forks source link

A trouble of using nw-gyp #94

Closed songlei200140316 closed 7 years ago

songlei200140316 commented 7 years ago

When build a c++ addon use nw-gyp ,i got a error as follows . but i can build it use vs2013 . The c++ addon building use node-gyp work well on node.js. The same code ,if use "nw-gyp configure --target=0.16.1" and build use vs2031. it's have same problems working on nw.js. some functions always return wrong result.I am not sure if it related to the mistake .Who can give me a help ,thanks!

D:\nwjs\nwjs-sdk-v0.16.1-win-ia32\Rxxx>nw-gyp build
gyp info it worked if it ends with ok
gyp info using nw-gyp@3.4.0
gyp info using node@6.3.1 | win32 | ia32
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack TypeError: Invalid Version: undefined
gyp ERR! stack     at new SemVer (C:\Users\Administrator\AppData\Roaming\npm\node_modules\.nw-gyp_npminstall\node_modules\.5.3.0@semver\semver.js:279:11)
gyp ERR! stack     at compare (C:\Users\Administrator\AppData\Roaming\npm\node_modules\.nw-gyp_npminstall\node_modules\.5.3.0@semver\semver.js:566:10)
gyp ERR! stack     at Function.gt (C:\Users\Administrator\AppData\Roaming\npm\node_modules\.nw-gyp_npminstall\node_modules\.5.3.0@semver\semver.js:595:10)
gyp ERR! stack     at C:\Users\Administrator\AppData\Roaming\npm\node_modules\.nw-gyp_npminstall\node_modules\.3.4.0@nw-gyp\lib\build.js:67:22
gyp ERR! stack     at C:\Users\Administrator\AppData\Roaming\npm\node_modules\.nw-gyp_npminstall\node_modules\.4.1.6@graceful-fs\graceful-fs.js:78:16
gyp ERR! stack     at tryToString (fs.js:455:3)
gyp ERR! stack     at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:442:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\.nw-gyp_npminstall\\node_modules\\.3.4.0@nw-gyp\\bin\\nw-gyp.js" "build"
gyp ERR! cwd D:\nwjs\nwjs-sdk-v0.16.1-win-ia32\Rxxx
gyp ERR! node -v v6.3.1
gyp ERR! nw-gyp -v v3.4.0
gyp ERR! This is a bug in`nw-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR!     https://github.com/nwjs/nw-gyp/issues

D:\nwjs\nwjs-sdk-v0.16.1-win-ia32\Rxxx>
bhavyaw commented 7 years ago

@songlei200140316 were you able to find a solution to this ? I am getting the same error!!

ghostoy commented 7 years ago

nw-gyp is running on Node.js not NW.js. So it's not possible to get actual version of NW.js. --target is required.

AnnamrajuSarvani commented 7 years ago

nw-gyp build --target=0.22.3, I get following error: I am using latest stable nw 0.22.3, my node version is 5.11.0 and I am building on ubuntu 14.04 what is the issue? make: Leaving directory /home/cronj-10/Sarvani/offline-sample-app-new/node_modules/java/build' gyp ERR! build error gyp ERR! stack Error:make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/home/cronj-10/.nvm/versions/node/v5.11.0/lib/node_modules/nw-gyp/lib/build.js:294:23) gyp ERR! stack at emitTwo (events.js:100:13) gyp ERR! stack at ChildProcess.emit (events.js:185:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12) gyp ERR! System Linux 3.13.0-115-generic gyp ERR! command "/home/cronj-10/.nvm/versions/node/v5.11.0/bin/node" "/home/cronj-10/.nvm/versions/node/v5.11.0/bin/nw-gyp" "build" "--target=0.22.3" gyp ERR! cwd /home/cronj-10/Sarvani/offline-sample-app-new/node_modules/java gyp ERR! node -v v5.11.0 gyp ERR! nw-gyp -v v3.4.0 gyp ERR! not ok