Edge: Distributing Edge.js applications

Created on 20 May 2015  Â·  21Comments  Â·  Source: tjanczuk/edge

I have a WebSocket server running in my development environment using the example and the ws package. It's working great! How would I package this up for distribution on other machines without Visual Studio 2013 installed? I can't seem to figure out the prerequisites to get the application running on a non-development Windows 7 x64 machine.

Most helpful comment

We are facing same issue on Production with node 8.10.0.

error: uncaughtException: The specified module could not be found.
at ..................node_modules\edge\lib\native\win32\x648.2.1\edge_nativeclr.node

We tried to replicate same on a new local machine, It worked fine till we unistall VC++ 2015 onward version. Then to be sure that VC++ 2015 is problem and required on production. we installed it again then uninstall. But now application is working without VC++ 2015.
Any thoughts??

All 21 comments

I keep getting the following error message. If I install Visual Studio 2013, it goes away and functions correctly.

module.js:355
Module._extensionsextension;
^
Error: The specified module could not be found.
c:\Debug\edge\x86\edge.node
at Error (native)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (c:\Debug\edge\edge.js:41:8)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)

As of now, the minimum set I have to install to get around this issue is .NET Framework 4.5._1_ and the Visual Studio 2013 Build Tools.
Am I missing something simpler?

Oh hey, I have the same problem! Have you found a solution yet, by chance?

Edit: your solution does in fact work. What I'm asking is if you figured out a way to include the required binaries without having to install Build Tools? I'm going to test installing C++ redistributable - that may substitute for Build Tools and is a more standard install requirement than Build Tools.

I'm going to test installing C++ redistributable - that may substitute for Build Tools and is a more standard install requirement than Build Tools

That should do the trick. Make sure to pick redist architecture matching the architecture of your node executable (i.e. 32 or 64 bit).

Any idea if I can just include node.exe in same directory as node.dll or similar? I could include both 32bit and 64bit in the respective directories...

@tjanczuk You are absolutely correct, Visual C++ Redistributable Packages for Visual Studio 2013 did the trick. And it looks like I do NOT need node.js installed at all. I'm not sure why the instructions say that I do?

So, does this mean that it is possible to distribute the edgejs based application to people who does not have installed any dependencies on their machine?

@stephan-nordnes-eriksen, as far as I can tell, what it means is you can distribute edgejs based application with only the following two installed requirements:

  1. .NET Framework 4.5.1
  2. Visual C++ Redistributable Packages for Visual Studio 2013 (32 or 64 bit, depending on the machine)

Node.js does _not_ have to be installed.

So edgejs is essentially a no-go if you want to make a application you want to distribute to consumers?

Correct. If your customers do not have and cannot install .net and c++ redistributable package and you are unable to bootstrap them into your app installer, then no, you will not be able to ship edgejs.

AFAIK .NET comes pre-installed on virtually all Windows SKUs that ship these days. As for C++ Redistributable package, the model is to include it in your application if you depend on it, that is why it is called "redistributable".

@tjanczuk Interesting. I want to make an electron app that can be downloaded and used, and use edge to utilize some native-features of windows through C#. Would I simply include the C++ Redistributable package and "hope" they have .NET?

If this is possible, I would greatly appreciate a simple example! (I am working on one now, but I am not 100% confident it will work).

The way I would approach it is to create an installer for your app that

  • checks for presence of .NET framework 4.5 and bails out with a message if absent (and I think this will in practice only affect very few people with very old OSes),
  • includes the necessary bits from VC++ Redist (note this needs to be architecture-specific, x86 or x64).

I have not created Windows installers for ages and I have no ready examples. Based on my past experiences I can say there are no silver bullets in this process. Create & test on target platforms, then rinse and repeat, and be prepared for a long slog.

So I was successfully able to bundle a .dll with an electron app and have it work on a machine which most likely did not have any installed requirements on it. (I did this remotely so I was not able to check, but the owner isn't a techie, so I doubt he have ever installed anything extra on his machine).

I had to use [email protected] to get this to work.

I think I understand now (this confuses me every time about edge.js). You are trying to run .NET code from node.js. In which case I think you are right, no C++ redistributable is required, as node is already running via Electron.

My requirement was to run node.js script completely from a .NET assembly, without installing node.js. In this instance, since (as I understand it) @tjanczuk packaged node in a .NET library, node requires C++ to be run like that.

Sorry for the confusion! I'm glad your solution worked.

Yep, the node.dll is what is called "double edge" :-)

On Sat, Sep 12, 2015 at 9:51 AM ivoloshin [email protected] wrote:

I think I understand now (this confuses me every time about edge.js). You
are trying to run .NET code from node.js. In which case I think you are
right, no C++ redistributable is required, as node is already running via
Electron.

My requirement was to run node.js script completely from a .NET assembly,
without installing node.exe. In this instance since (as I understand it)
@tjanczuk https://github.com/tjanczuk packaged node in a .NET library,
node requires C++ to be run like that.

Sorry for the confusion! I'm glad your solution worked.

—
Reply to this email directly or view it on GitHub
https://github.com/tjanczuk/edge/issues/280#issuecomment-139796419.

I have a win 10 fresh install, it comes with .NET Framework 4.6.1.
I installed Visual C++ Redistributable Packages for Visual Studio 2013 but it does not work, I keep getting the same error.
(also tried with vc++ redist for VS 2015)

Did you check your app runs in the architecture mode you installed the redistributable for?

Visual C++ Redistributable Packages for Visual Studio 2013 (32 or 64 bit, depending on the machine)

You are right, it seems the app runs in 32 bits, installing the 32 bits redist did the trick, thanks!

Quick update to this, we've updated from 0.10.0 to 8.2.1 and the library now requires Visual C++ Redistributable Packages for Visual Studio 2017. Not sure as of which version that change happened.

We are facing same issue on Production with node 8.10.0.

error: uncaughtException: The specified module could not be found.
at ..................node_modules\edge\lib\native\win32\x648.2.1\edge_nativeclr.node

We tried to replicate same on a new local machine, It worked fine till we unistall VC++ 2015 onward version. Then to be sure that VC++ 2015 is problem and required on production. we installed it again then uninstall. But now application is working without VC++ 2015.
Any thoughts??

Was this page helpful?
0 / 5 - 0 ratings

Related issues

WinterWoods picture WinterWoods  Â·  10Comments

NickStrupat picture NickStrupat  Â·  11Comments

tdupuy17 picture tdupuy17  Â·  6Comments

0xF6 picture 0xF6  Â·  4Comments

EricSmekens picture EricSmekens  Â·  7Comments