agracio / edge-js

Run .NET and Node.js code in-process on Windows, macOS, and Linux
MIT License
643 stars 95 forks source link

edge-js installation failing on OSX #133

Closed vineetmimrot closed 7 months ago

vineetmimrot commented 3 years ago

Hey, I am trying running a sample c# code from Javascript using edge-js package. But the installation of edge-js is failing on OSX with the following error:

Package mono-2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `mono-2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'mono-2' found
gyp: Call to 'pkg-config mono-2 --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/runner/hostedtoolcache/node/14.17.0/x64/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
added 3 packages from 9 contributors and audited 3 packages in 8.274s
gyp ERR! stack     at ChildProcess.emit (events.js:376:20)
found 0 vulnerabilities
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)

gyp ERR! System Darwin 19.6.0
gyp ERR! command "/Users/runner/hostedtoolcache/node/14.17.0/x64/bin/node" "/Users/runner/hostedtoolcache/node/14.17.0/x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /Users/runner/work/sample-edge-js-project/sample-edge-js-project/node_modules/edge-js
gyp ERR! node -v v14.17.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm WARN sample-edge-js-project@1.0.0 No description

Logs: https://github.com/vineetmimrot/sample-edge-js-project/runs/2685891023?check_suite_focus=true

The OSX already installed DotNetCore 5.0, do we really need mono installed?

On Windows, if I set env variable EDGE_USE_CORECLR = 1, then at runtime the code fails, otherwise, it is success. Can you please tell what am I missing here?

Also, I have seen that npm install edge-js also installs dotnetcore sdk. Is it correct? Does it use the same SDK for running edge-js library in the user's code?

You can get the installed tools available during runtime on Windows & OSX machine.

vineetmimrot commented 3 years ago

@agracio Can you please help?