tjanczuk / edge

Run .NET and Node.js code in-process on Windows, MacOS, and Linux
http://tjanczuk.github.io/edge
Other
5.41k stars 639 forks source link

error executing helloworld example #495

Closed elenaaralla closed 2 weeks ago

elenaaralla commented 8 years ago

Hi,

I'm testing edge, but I've some problem...

I'm working on MAC OSX El Capitain (v 10.11.6)

I installed all the prerequisites, as described in https://github.com/tjanczuk/edge/#building-on-osx (Homebrew, Mono x64, node.js x64) without problem.

I installed edge without error.

I created server.js as described in https://github.com/tjanczuk/edge/ (How to: C# hello, world section)

var edge = require('edge');

var helloWorld = edge.func(function () {/*
    async (input) => { 
        return ".NET Welcomes " + input.ToString(); 
    }
*/});

helloWorld('JavaScript', function (error, result) {
    if (error) throw error;
    console.log(result);
});

but when i run $>node server.js

this error occurred:

bash-3.2$ node server.js Error: assembly specified in the dependencies manifest was not found -- package: 'Edge.js.CSharp', version: '1.2.0', path: 'lib/netstandard1.6/Edge.js.CSharp.dll' /Users/elena/projects/ASX_EDJE/node_modules/edge/lib/edge.js:171 return edge.initializeClrFunc(options); ^

TypeError: edge.initializeClrFunc is not a function at Object.exports.func (/Users/elena/projects/ASX_EDJE/node_modules/edge/lib/edge.js:171:17) at Object. (/Users/elena/projects/ASX_EDJE/server.js:3:23) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Function.Module.runMain (module.js:447:10) at startup (node.js:146:18) at node.js:404:3 bash-3.2$

can anyone help me?

Thank you very much, elena.

michaelskiles commented 7 years ago

Did you sort this one out? I'm having the same issue.

elenaaralla commented 7 years ago

No, sorry... no help for this issue :(

for now I have abandoned this project ... I hope you have better luck. Good day.

elenaaralla commented 7 years ago

Let me know if you'll sort it out, thank you.

n4rk0o commented 7 years ago

I have the same behavior on RHEL 7.2.

oldtimerza commented 7 years ago

I am also currently experiencing this problem.

`    return edge.initializeClrFunc(options);
               ^

TypeError: Cannot read property 'initializeClrFunc' of undefined`

but the module is being loaded correctly as it returns a function on console.log(edge) using the electron-edge package. Node : 6.4.0 NPM: 4.3.0

Have all the necessary requirements installed of all the correct versions on windows 7 64 bit

fgodoy commented 7 years ago

I have here a similar issue. Anyone can help, please?

$ node sample C:\Projetos\VSCodeExtension\EdgeElectronTest\node_modules\electron-edge\lib\edge.js:169 return edge.initializeClrFunc(options); ^

TypeError: Cannot read property 'initializeClrFunc' of undefined at Object.exports.func (C:\Projetos\VSCodeExtension\EdgeElectronTest\node_modules\electron-edge\lib\edge.js:169:16) at Object. (C:\Projetos\VSCodeExtension\EdgeElectronTest\sample.js:3:23) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.runMain (module.js:605:10) at run (bootstrap_node.js:420:7) at startup (bootstrap_node.js:139:9)

agracio commented 7 years ago

The error appears to be related to electron-edge package only and not edge. Perhaps because its built specifically for electron it should also be tested in electron app and not in console.

fgodoy commented 7 years ago

I found the problem and yes, this is a electron-edge specific error. The solution was use version 6.5.2 of gem. For some reason that I don't know works with older version.

weliwita commented 7 years ago

The reason is that electron-edge use specific target to build the edge. In tools\build.bat "%NODEEXE%" "%GYP%" configure build --target=1.6.2 --dist-url=https://atom.io/download/atom-shell --msvs_version=2015 -%FLAVOR% The target is the corresponding node-gyp(iojs) version that matches the electron version. You can find the installed versions in .node-gyp and .electron folders in your %UserProfile% If you have the wrong version of electron running the app other than one edge module is built for above error could occur.