Trouble in nw-gyp with 0.13

1,130 views
Skip to first unread message

Jean-Philippe Côté

unread,
Jan 24, 2016, 1:46:13 PM1/24/16
to nw.js
I'm trying to use the Johnny-Five framework with NW.js version 0.13.0-beta4. Since Johnny-Five depends on the serialport native module, I tried to recompile it for NW.js as per the instructions here: https://github.com/nwjs/nw.js/wiki/Build-native-modules-with-nw-gyp

Doing that, I ran into an issue. When I run nw-gyp configure --target=0.13.0-beta4 , I get the following error: 

gyp: name 'openssl_fips' is not defined while evaluating condition 'openssl_fips != ""' in binding.gyp

Since I do not need openssl, I tried again with:

nw-gyp configure --target=0.13.0-beta4 --openssl_fips=x

Now, I get the following error: Undefined variable module_name in binding.gyp

So I tried running node-pre-gyp build --runtime=node-webkit --target=0.13.0-beta4 as per the instructions on the page. Now I get: 

make: *** No targets specified and no makefile found.  Stop.

Has anybody been able to build native modules for NW.js version 0.13.0 ?

Thanks.

P.S. I'm on Mac (Yosemite)

Jean-Philippe Côté

unread,
Jan 24, 2016, 4:37:45 PM1/24/16
to nw.js
I'm getting closer. I finally was able to recompile it by simply running the following:

node-pre-gyp rebuild --runtime=node-webkit --target=0.13.0-beta4

However, as soon as I try to create Johnny-Five's Board object, NW.js crashes with the following:

dyld: lazy symbol binding failed: Symbol not found: __ZN2v87Isolate10GetCurrentEv
  Referenced from: /Users/jpcote/Documents/DATA/PiezoMusic/node_modules/johnny-five/node_modules/serialport/build/Release/node-webkit-v0.13.0-beta4-darwin-x64/serialport.node
  Expected in: dynamic lookup

dyld: Symbol not found: __ZN2v87Isolate10GetCurrentEv
  Referenced from: /Users/jpcote/Documents/DATA/PiezoMusic/node_modules/johnny-five/node_modules/serialport/build/Release/node-webkit-v0.13.0-beta4-darwin-x64/serialport.node
  Expected in: dynamic lookup

Ideas?


Here's the callstack, just in case:

(
        0   AppKit                              0x00007fff818ee54d -[NSThemeFrame addSubview:] + 107
        1   AppKit                              0x00007fff818ee03f -[NSView addSubview:positioned:relativeTo:] + 208
        2   NWJS Framework                      0x000000010aae4edb _ZN2v88UnlockerD1Ev + 21017371
        3   NWJS Framework                      0x000000010aa39cbc _ZN2v88UnlockerD1Ev + 20316412
        4   NWJS Framework                      0x000000010aa440f2 _ZN2v88UnlockerD1Ev + 20358450
        5   NWJS Framework                      0x000000010ab49905 _ZN2v88UnlockerD1Ev + 21429573
        6   NWJS Framework                      0x0000000107ecf2f2 ChromeMain + 4153026
        7   NWJS Framework                      0x0000000107ecebc0 ChromeMain + 4151184
        8   NWJS Framework                      0x0000000107ece4c4 ChromeMain + 4149396
        9   NWJS Framework                      0x0000000107ece2d3 ChromeMain + 4148899
        10  NWJS Framework                      0x000000010ba4fe72 _ZN2v88UnlockerD1Ev + 37184178
        11  NWJS Framework                      0x000000010b523941 _ZN2v88UnlockerD1Ev + 31759745
        12  NWJS Framework                      0x000000010b5259a9 _ZN2v88UnlockerD1Ev + 31768041
        13  NWJS Framework                      0x000000010b525bcf _ZN2v88UnlockerD1Ev + 31768591
        14  NWJS Framework                      0x000000010b53ef02 _ZN2v88UnlockerD1Ev + 31871810
        15  NWJS Framework                      0x000000010b72a04f _ZN2v88UnlockerD1Ev + 33883279
        16  NWJS Framework                      0x000000010b04fdb4 _ZN2v88UnlockerD1Ev + 26698228
        17  NWJS Framework                      0x000000010ae310cf _ZN2v88UnlockerD1Ev + 24474895
        18  NWJS Framework                      0x000000010af72e19 _ZN2v88UnlockerD1Ev + 25793113
        19  NWJS Framework                      0x0000000108a87f18 ChromeMain + 16444136
        20  NWJS Framework                      0x0000000107fd4aaa ChromeMain + 5224058
        21  NWJS Framework                      0x0000000107ff7469 ChromeMain + 5365817
        22  NWJS Framework                      0x0000000107ff79b6 ChromeMain + 5367174
        23  NWJS Framework                      0x0000000107fc9d41 ChromeMain + 5179665
        24  NWJS Framework                      0x0000000107fedbba ChromeMain + 5326730
        25  NWJS Framework                      0x0000000107fc9744 ChromeMain + 5178132
        26  CoreFoundation                      0x00007fff873a9a01 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
        27  CoreFoundation                      0x00007fff8739bb8d __CFRunLoopDoSources0 + 269
        28  CoreFoundation                      0x00007fff8739b1bf __CFRunLoopRun + 927
        29  CoreFoundation                      0x00007fff8739abd8 CFRunLoopRunSpecific + 296
        30  HIToolbox                           0x00007fff86d7856f RunCurrentEventLoopInMode + 235
        31  HIToolbox                           0x00007fff86d782ea ReceiveNextEventCommon + 431
        32  HIToolbox                           0x00007fff86d7812b _BlockUntilNextEventMatchingListInModeWithFilter + 71
        33  AppKit                              0x00007fff8193d8ab _DPSNextEvent + 978
        34  AppKit                              0x00007fff8193ce58 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 346
        35  AppKit                              0x00007fff81932af3 -[NSApplication run] + 594
        36  NWJS Framework                      0x0000000107fca491 ChromeMain + 5181537
        37  NWJS Framework                      0x0000000107fc9b94 ChromeMain + 5179236
        38  NWJS Framework                      0x0000000108009e73 ChromeMain + 5442115
        39  NWJS Framework                      0x0000000107b6c405 ChromeMain + 602069
        40  NWJS Framework                      0x000000010ad804a7 _ZN2v88UnlockerD1Ev + 23750887
        41  NWJS Framework                      0x000000010ad82d22 _ZN2v88UnlockerD1Ev + 23761250
        42  NWJS Framework                      0x000000010ad7bf4d _ZN2v88UnlockerD1Ev + 23733133
        43  NWJS Framework                      0x0000000107f85208 ChromeMain + 4898264
        44  NWJS Framework                      0x0000000107f846a6 ChromeMain + 4895350
        45  NWJS Framework                      0x0000000107ad9472 ChromeMain + 66
        46  nwjs                                0x0000000107a71d52 main + 530
        47  nwjs                                0x0000000107a71b34 nwjs + 2868
)






olivier.allouch

unread,
Jan 25, 2016, 8:37:55 AM1/25/16
to nw.js
I also tried without success, but I'm good with version 0.12.3 .

Jean-Philippe Côté

unread,
Jan 25, 2016, 4:03:48 PM1/25/16
to nw.js
Does anybody know if this is a problem with nw-gyp or with NW.js ? I'm not sure where to go for further help. 

Thanks.

Rodrigo Pandini

unread,
Jan 26, 2016, 7:54:11 AM1/26/16
to Jean-Philippe Côté, nw.js
Hi Jean,

I follow your steps and I got no erros on Windows 7 - 64 bits.
Maybe is a problem only in Mac.
Can you paste the code that you are using to create the Board object?

I use the follow code to test:
<!DOCTYPE html>
<html>
<head>
  <title>NW.js</title>
</head>
<body>
<script>
require('nw.gui').Window.get().showDevTools();
var SerialPort = nw.require("serialport").SerialPort;
var five = require("johnny-five");
var board = new five.Board({
  port: new SerialPort("COM4", {
    baudrate: 9600,
    buffersize: 1
  })
});
console.log(board);
</script>
</body>
</html>

The console log:
  1. Board
    1. DriversObject
    2. debugtrue
    3. id"AB60C82A-5516-408F-90B0-440F6156326D"
    4. ioBoard
    5. isConnectedtrue
    6. isReadyfalse
    7. occupiedArray[0]
    8. pinsnull
    9. port"COM4"
    10. registerArray[0]
    11. replRepl
    12. siginttrue
    13. timerTimeout
    14. __proto__Board


2016-01-25 19:03 GMT-02:00 Jean-Philippe Côté <cot...@gmail.com>:
Does anybody know if this is a problem with nw-gyp or with NW.js ? I'm not sure where to go for further help. 

Thanks.

--
You received this message because you are subscribed to the Google Groups "nw.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nwjs-general...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

TrevorPT

unread,
Jan 26, 2016, 9:44:05 AM1/26/16
to nw.js
I've been in the process of figuring out node-gyp for other native modules, so I'm not that familiar with it, but shouldn't target be the version of node that you are targetting and not the version of nw.js ?  ie. nw.js 0.13.0-beta4 would be --target=5.4.1 ?  What version of node.js are you using?  I ran into problems when I tried using an older version of node (0.10) than I was trying to compile for (io.js 1.2.0 which is nw.js 0.12) -- unless the --runtime flag maps the target to the correct version -- but when I installed the right version of io.js, it (nodehun) built just fine.

TrevorPT

unread,
Jan 26, 2016, 9:50:34 AM1/26/16
to nw.js
My mistake, I didn't notice you were using 'nw-gyp'; I had been using 'node-gyp', which worked for building nodehun for nw.js 0.12.3.  I didn't know of either nw-gyp or node-pre-gyp so my previous post might not be of any help.

Jean-Philippe Côté

unread,
Jan 26, 2016, 2:51:16 PM1/26/16
to nw.js, cot...@gmail.com
Rodrigo,

Thanks a lot for your input. I'm a bit busy at the moment, but ll take some time tomorrow to put together a minimal example displaying the problem. I guess I'll open a new issue on GitHub to make tracking easier.

Cheers!

Jean-Philippe Côté

unread,
Jan 27, 2016, 10:40:43 AM1/27/16
to nw.js, cot...@gmail.com
I tried Rodrigo's code and I get the same error. For me, the simplest code that triggers the error is:

<html lang="en">

  <head>
    <meta charset="UTF-8">
    <title>NW.js 0.13 Johnny-Five Test</title>
    <script>
      var five = nw.require("johnny-five");
      var board = new five.Board();
    </script>
  </head>

  <body>
    NW.js 0.13 Johnny-Five Test
  </body>

</html>

I got my hands on a Windows 8.1 box to see if I could make it work and am unable to rebuild serialport. I constantly get the following error: "Failed to execute 'node-gyp.cmd clean' (Error: spawn node-gyp.cmd ENOENT)"

Jean-Philippe Côté

unread,
Jan 27, 2016, 11:06:31 AM1/27/16
to nw.js, cot...@gmail.com
Rodrigo,

Would you mind sending me a copy of the recompiled serialport module ? I would like to try it in Windows but I have been unsuccessful at rebuilding it.

Thanks a bunch!

Rodrigo Pandini

unread,
Jan 27, 2016, 11:10:01 AM1/27/16
to Jean-Philippe Côté, nw.js
Did you install node-gyp globally?

"npm install -g node-gyp"

Also, you need install nw-gyp and node-pre-gyp globally.
Make sure that you have the necessary tools to build node native modules (addons). In Windows is Python 2.7 and Visual Studio.

You can specifying the version of Visual Studio that you will use, if it is not define early or if you will use diferent version that are defined.

node-pre-gyp rebuild --runtime=node-webkit --target=0.13.0-beta4 --msvs_version=2013

2016-01-27 14:08 GMT-02:00 Rodrigo Pandini <rodrigo...@gmail.com>:
Did you install node-gyp globally?

"npm install -g node-gyp"

Also, you need install nw-gyp and node-pre-gyp globally.
Make sure that you have the necessary tools to build node native modules (addons). In Windows is Python 2.7 and Visual Studio.

You can specifying the version of Visual Studio that you will use, if it is not define early or if you will use diferent version that are defined.

node-pre-gyp rebuild --runtime=node-webkit --target=0.13.0-beta4 --msvs_version=2013


Pedro Lucas da Silva Junior

unread,
Jan 27, 2016, 12:05:33 PM1/27/16
to Rodrigo Pandini, Jean-Philippe Côté, nw.js
Go to node_modules/serialport then execute: 

node-pre-gyp install --fallback-to-build --runtime=node-webkit --target=0.13.0-beta4

Try it!

Pedro Lucas.

Pedro Lucas da Silva Junior

unread,
Jan 27, 2016, 1:47:09 PM1/27/16
to Rodrigo Pandini, Jean-Philippe Côté, nw.js
Sorry about last answer, but I think it's a issue in version 0.13.0-beta4. I had the same error which Jean.

dyld: lazy symbol binding failed: Symbol not found: __ZN2v87Isolate10GetCurrentEv

I tried in version 0.12.3 and everything goes right.

Pedro Lucas.

Jean-Philippe Côté

unread,
Jan 27, 2016, 3:13:55 PM1/27/16
to nw.js, rodrigo...@gmail.com, cot...@gmail.com
On my Mac, I'm able to recompile the module. It's when I try to run it that the problem arises. 
I will have a bit more time later today. I'll try the same on Windows 7 and Windows 8.1. I'll keep you guys posted.

Cheers!

Pedro Lucas da Silva Junior

unread,
Jan 27, 2016, 5:00:16 PM1/27/16
to Jean-Philippe Côté, nw.js, Rodrigo Pandini
I had the same issue when I tried to build the library lwip.

It can be a issue in the version 0.13.

dyld: lazy symbol binding failed: Symbol not found: __ZN2v87Isolate10GetCurrentEv

  Referenced from: /Users/MyUser/Documents/Repository/project/node_modules/lwip/build/Release/lwip_image.node

  Expected in: dynamic lookup


--

mikef...@gmail.com

unread,
Jan 28, 2016, 10:15:52 AM1/28/16
to nw.js
For what it's worth [I know this isn't solving the problem at hand], I have stopped using the serialport module and am now instead using chrome.serial.  I couldn't get serialport to build, even after fiddling with nan versions like I was able to do in earlier 0.13 betas.

Jean-Philippe Côté

unread,
Jan 28, 2016, 10:22:13 AM1/28/16
to nw.js, mikef...@gmail.com
Yeah, I thought about doing that. However, it would have to work inside Johnny-Five which is the library I need to use. I don't think it will right out of the box...


Jean-Philippe Côté

unread,
Jan 29, 2016, 4:12:50 PM1/29/16
to nw.js, mikef...@gmail.com
It seems to be Mac-only. I, too, was able to use the serialport module in Windows 7.

I opened an issue on GitHub (https://github.com/nwjs/nw.js/issues/4338)

zsl...@gmail.com

unread,
Mar 18, 2016, 3:37:59 AM3/18/16
to nw.js
Hi all, I'm also building serialport.
I'm good with:

 $ node-pre-gyp build --runtime=node-webkit --target=0.13.0-beta7

But not with rc3, with error:

 $ node-pre-gyp build --runtime=node-webkit --target=0.13.0-rc3 --python=/usr/bin/python2

node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-p...@0.6.23
node-pre-gyp info using no...@5.8.0 | linux | x64
gyp info it worked if it ends with ok
gyp info using nw-...@0.13.0
gyp info using no...@5.8.0 | linux | x64
(node) child_process: options.customFds option is deprecated. Use options.stdio instead.
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/bob/test/node_modules/serialport/build'
  CXX(target) Release/obj.target/serialport/src/serialport.o
In file included from ../../nan/nan.h:25:0,
                 from ../src/serialport.h:5,
                 from ../src/serialport.cpp:3:
/home/bob/.nw-gyp/0.13.0-rc3/src/node_buffer.h:13:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
 #pragma clang diagnostic push
 ^
/home/bob/.nw-gyp/0.13.0-rc3/src/node_buffer.h:14:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
 #pragma clang diagnostic ignored "-Wignored-attributes"
 ^
/home/bob/.nw-gyp/0.13.0-rc3/src/node_buffer.h:16:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
 #pragma clang diagnostic pop
 ^
In file included from ../../nan/nan.h:25:0,
                 from ../src/serialport.h:5,
                 from ../src/serialport.cpp:3:
/home/bob/.nw-gyp/0.13.0-rc3/src/node_buffer.h:15:64: warning: ‘visibility’ attribute ignored [-Wattributes]
 NODE_EXTERN typedef void (*FreeCallback)(char* data, void* hint);
                                                                ^
In file included from ../src/serialport.h:5:0,
                 from ../src/serialport.cpp:3:
../../nan/nan.h:590:20: error: variable or field ‘AddGCEpilogueCallback’ declared void
       v8::Isolate::GCEpilogueCallback callback
                    ^
../../nan/nan.h:590:7: error: ‘GCEpilogueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCEpilogueCallback callback
       ^
../../nan/nan.h:591:18: error: expected primary-expression before ‘gc_type_filter’
     , v8::GCType gc_type_filter = v8::kGCTypeAll) {
                  ^
../../nan/nan.h:596:20: error: variable or field ‘RemoveGCEpilogueCallback’ declared void
       v8::Isolate::GCEpilogueCallback callback) {
                    ^
../../nan/nan.h:596:7: error: ‘GCEpilogueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCEpilogueCallback callback) {
       ^
../../nan/nan.h:601:20: error: variable or field ‘AddGCPrologueCallback’ declared void
       v8::Isolate::GCPrologueCallback callback
                    ^
../../nan/nan.h:601:7: error: ‘GCPrologueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCPrologueCallback callback
       ^
../../nan/nan.h:602:18: error: expected primary-expression before ‘gc_type_filter’
     , v8::GCType gc_type_filter = v8::kGCTypeAll) {
                  ^
../../nan/nan.h:607:20: error: variable or field ‘RemoveGCPrologueCallback’ declared void
       v8::Isolate::GCPrologueCallback callback) {
                    ^
../../nan/nan.h:607:7: error: ‘GCPrologueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCPrologueCallback callback) {
       ^
serialport.target.mk:88: recipe for target 'Release/obj.target/serialport/src/serialport.o' failed
make: *** [Release/obj.target/serialport/src/serialport.o] Error 1
make: Leaving directory '/home/bob/test/node_modules/serialport/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/nw-gyp/lib/build.js:286: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 4.4.1-2-ARCH
gyp ERR! command "/usr/bin/node" "/usr/bin/nw-gyp" "build" "--runtime=node-webkit" "--target=0.13.0-rc3" "--python=/usr/bin/python2" "--module=/home/bob/test/node_modules/serialport/build/Release/node-webkit-v0.13.0-rc3-linux-x64/serialport.node" "--module_name=serialport" "--module_path=/home/bob/test/node_modules/serialport/build/Release/node-webkit-v0.13.0-rc3-linux-x64"
gyp ERR! cwd /home/bob/test/node_modules/serialport
gyp ERR! node -v v5.8.0
gyp ERR! nw-gyp -v v0.13.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute 'nw-gyp build --runtime=node-webkit --target=0.13.0-rc3 --python=/usr/bin/python2 --module=/home/bob/test/node_modules/serialport/build/Release/node-webkit-v0.13.0-rc3-linux-x64/serialport.node --module_name=serialport --module_path=/home/bob/test/node_modules/serialport/build/Release/node-webkit-v0.13.0-rc3-linux-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:100:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:850:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
node-pre-gyp ERR! System Linux 4.4.1-2-ARCH
node-pre-gyp ERR! command "/usr/bin/node" "/usr/bin/node-pre-gyp" "build" "--runtime=node-webkit" "--target=0.13.0-rc3" "--python=/usr/bin/python2"
node-pre-gyp ERR! cwd /home/bob/test/node_modules/serialport
node-pre-gyp ERR! node -v v5.8.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.23
node-pre-gyp ERR! not ok 
Failed to execute 'nw-gyp build --runtime=node-webkit --target=0.13.0-rc3 --python=/usr/bin/python2 --module=/home/bob/test/node_modules/serialport/build/Release/node-webkit-v0.13.0-rc3-linux-x64/serialport.node --module_name=serialport --module_path=/home/bob/test/node_modules/serialport/build/Release/node-webkit-v0.13.0-rc3-linux-x64' (1)

I also try rc1 and rc2, both not working well. 

Thanks.

Murray Hopkins

unread,
Nov 11, 2016, 1:48:42 AM11/11/16
to nw.js
Hi TrevorPT.

I am picking up on your comment "I had been using 'node-gyp', which worked for building nodehun for nw.js 0.12.3". 

Sorry to hijack this but I am trying to do the same and this is the only reference I have seen that someone has actually done it. Would you be able to give me a heads up on how you did that please? I keep running into node and modules version clashes and was beginning to think I would need to update to a leter version of nwjs. Any pointers you could give would be great! I am building on Windows 7 and OSX. It is my first experience with trying to use native modules.

Thanks,
Murray
Reply all
Reply to author
Forward
0 new messages