Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Building with node-webkit #5

Open
mikeptweet opened this Issue · 15 comments

5 participants

@mikeptweet

First of all, this is awesome ... thanks for putting this together.

I am trying to build the module to use in node-webkit, following the instructions here

https://github.com/rogerwang/nw-gyp

I get the following errors ...

C:\owin-master>nw-gyp build
gyp info it worked if it ends with ok
gyp info using nw-gyp@0.7.3-4
gyp info using node@0.8.21 | win32 | x64
gyp info spawn msbuild
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args '/clp:Verbosity=minimal',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=Win32' ]
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
utils.cpp
clrfuncinvokecontext.cpp
nodejsfunc.cpp
owinjavascriptconverter.cpp
c:\owin-master\src\owin.h(135): error C2217: 'override' requires 'virtual' [C:\
owin-master\build\owin.vcxproj]
c:\owin-master\src\owin.h(135): error C2217: 'override' requires 'virtual' [C:\
owin-master\build\owin.vcxproj]
c:\owin-master\src\owin.h(135): error C2217: 'override' requires 'virtual' [C:\
owin-master\build\owin.vcxproj]
c:\owin-master\src\owin.h(143): error C2217: 'override' requires 'virtual' [C:\
owin-master\build\owin.vcxproj]
c:\owin-master\src\owin.h(143): error C2217: 'override' requires 'virtual' [C:\
owin-master\build\owin.vcxproj]
c:\owin-master\src\owin.h(143): error C2217: 'override' requires 'virtual' [C:\
owin-master\build\owin.vcxproj]
c:\owin-master\src\owin.h(135): error C2217: 'override' requires 'virtual' [C:\
owin-master\build\owin.vcxproj]
c:\owin-master\src\owin.h(147): error C2217: 'override' requires 'virtual' [C:\
owin-master\build\owin.vcxproj]
c:\owin-master\src\owin.h(147): error C2217: 'override' requires 'virtual' [C:\
owin-master\build\owin.vcxproj]
c:\owin-master\src\owin.h(147): error C2217: 'override' requires 'virtual' [C:\
owin-master\build\owin.vcxproj]
c:\owin-master\src\owin.h(143): error C2217: 'override' requires 'virtual' [C:\
owin-master\build\owin.vcxproj]
c:\owin-master\src\owin.h(147): error C2217: 'override' requires 'virtual' [C:\
owin-master\build\owin.vcxproj]
nodejsfuncinvokecontext.cpp
clrfunc.cpp
owin.cpp
c:\owin-master\src\owin.h(135): error C2217: 'override' requires 'virtual' [C:\
owin-master\build\owin.vcxproj]
c:\owin-master\src\owin.h(143): error C2217: 'override' requires 'virtual' [C:\
owin-master\build\owin.vcxproj]
c:\owin-master\src\owin.h(147): error C2217: 'override' requires 'virtual' [C:\
owin-master\build\owin.vcxproj]
c:\owin-master\src\owin.h(135): error C2217: 'override' requires 'virtual' [C:\
owin-master\build\owin.vcxproj]
c:\owin-master\src\owin.h(143): error C2217: 'override' requires 'virtual' [C:\
owin-master\build\owin.vcxproj]
c:\owin-master\src\owin.h(147): error C2217: 'override' requires 'virtual' [C:\
owin-master\build\owin.vcxproj]
c:\owin-master\src\owin.h(135): error C2217: 'override' requires 'virtual' [C:\
owin-master\build\owin.vcxproj]
c:\owin-master\src\owin.h(143): error C2217: 'override' requires 'virtual' [C:\
owin-master\build\owin.vcxproj]
c:\owin-master\src\owin.h(147): error C2217: 'override' requires 'virtual' [C:\
owin-master\build\owin.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: msbuild failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\mparsons\AppData\Roaming\npm
\node_modules\nw-gyp\lib\build.js:232:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack at Process._handle.onexit (child_process.js:678:10)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\Users\mparsons\AppData\Roaming\npm\node_module
s\nw-gyp\bin\nw-gyp.js" "build"
gyp ERR! cwd C:\owin-master
gyp ERR! node -v v0.8.21
gyp ERR! nw-gyp -v v0.7.3-4
gyp ERR! not ok

Any chance you could have a look at this?

@tjanczuk
Owner

What are you trying to accomplish by recompiling the owin module with nw-gyp? The owin module is pre-compiled (it has x86 and x64 binaries included in the published npm package) and should be ready to use without building.

@mikeptweet

node modules being used in node-webkit need to be compiled against the headers from node-webkit or else they won't work.

@frankhale

Have you tried recompiling recently? I have successfully rebuilt Edge using nw-gyp and have it working inside of Node-Webkit.

Some issues that also relate:

#89
nwjs/nw.js#1332

@mikeptweet

still don't work for me ... can you attach your binary please

@frankhale

What exactly isn't working? I found setting up the build environment to be the most difficult part of this task. You bring up an interesting point when saying can I attach the binary. Comments on issues doesn't allow arbitrary file attachments. It'd be nice if an official version of the module could be put out that is built using nw-gyp instead of node-gyp. I don't have time today to upload the binary because it's not on the machine I am on right now. I could be bothered to recompile against the latest node-webkit and then zip it all up and put it somewhere. Once I do that I'll reply here with the link.

@frankhale

If you have time you can refer to my example node-webkit app that demonstrates a working Edge calling into .NET code from JS (which I had totally forgotten about). This is built and works with Node-Webkit 0.8.4. The node module is included. Additionally I've put instructions in the read me for those that want to build their own Edge using nw-gyp.

https://github.com/frankhale/nw-edge-example

@tjanczuk
Owner

It appears that use of node-webkit is becoming a popular scenario. I wonder if it would be useful for edge.js to support node-webkit out of the box. This would require checking in pre-compiled versions of edge.node that work with node-webkit, and the ability to choose these versions as opposed to regular edge.node versions at runtime when running in the context of a node-webkit app.

@frankhale, what do you think about the feasibility of this approach? Would you be willing to translate your example into a PR to edge.js that makes it possible?

@frankhale
@c0bra

Has there been any progress on this? @frankhale I used your recompiled edge.js module from https://github.com/frankhale/nw-edge-example and it's worked great (so far). Thanks so much for that.

It would be nice to not have to go through these steps, however.

@frankhale

There hasn't been any movement on this yet.

@c0bra

@frankhale Ah, OK. I was able to get edge.js working while running node-webkit through a karma-runner someone created, basically launching it manually.

But after using node-webkit-builder to create an NSIS-installed application I get "The specified module could not be found." from here: https://github.com/tjanczuk/edge/blob/master/lib/edge.js#L27 All the versions, architectures, etc match up perfectly. I am not re-building/recompiling anything, just copying the node_modules over for the build. Any ideas? I think I'm kind of stuck.

[Edit] Stuck no longer!

Dependency Walker revealed that the compiled edge.node was looking for nw.exe and I had renamed my executable to match my project name. Once I changed it back to "nw.exe" everything started working again.

@frankhale

Oh, yeah there is a lot of commentary on renaming the nw.exe executable. Here is one issue that has references to a lot of other ones: nwjs/nw.js#199

@kucai

just an update on the current status of this since I just setuped my project to work with nw and edge :

I managed to build edge for nw without any other problems than those already mentioned and solved here (using nw-gys rebuild --version=0.8.6 and then copying the .node file in the right place)

the build of edge does not work with the later versions of nw (I tried 0.10.2 and 0.10.3) because of the issue with node 0.11.6 #86

In the end it is not problematic for me because nw 0.8.6 is a maintained branch for the moment.

@c0bra

Update

This happened again to me, but in this case it was because the machine that the application was being installed on was missing msvcr100.dll. Dependency Walker again showed this when checking the edge.node file.

The strange thing is that msvcr100.dll is supposedly supplied by Microsoft Visual C++ 2010 Redistributable, but it's on other machines that only have 2005 and 2008, and the affected machine had both those versions as well.

Simply copying the DLL over fixed the problem. Just wanted to note here for posterity's sake!

@frankhale

The latest version of Edge compiles nicely against Node 0.12.x. I just got Edge working with Node-Webkit 0.12 and you can see an example here:

https://github.com/frankhale/nw-edge-example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.