I've had a search on both Google and in the issues of this repo for some help already - but drawn a blank.
I'm getting the following error when trying to install edge:
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 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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:340:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:807:12)
gyp ERR! System Darwin 13.1.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /Users/matt/Repositories/node-app/node_modules/edge
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok 
[email protected] node_modules/edge
└── [email protected]
I'm running with:
brew install script listed as part of the MacOS instructions in the readme).Any help suggested would be awesome - perhaps something I can fix as well.
What is the output of mono -V and pkg-config mono-2 --libs on your system after you have installed Mono using the brew formula from the instructions?
Thanks for getting back to me @tjanczuk.
Initially mono -V output the following:
Mono JIT compiler version 3.2.6 ((no/9b58377 Thu Jan 16 17:49:56 EST 2014)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           normal
    SIGSEGV:       altstack
    Notification:  kqueue
    Architecture:  x86
    Disabled:      none
    Misc:          softdebug 
    LLVM:          yes(3.3svn-mono-(no/8bdedb5)
    GC:            sgen
So which is my regular mono installation I guess. So I messed around with my path to ensure that mono -V then output:
Mono JIT compiler version 3.4.0 (tarball Sat 10 May 2014 13:47:19 BST)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           normal
    SIGSEGV:       altstack
    Notification:  kqueue
    Architecture:  amd64
    Disabled:      none
    Misc:          softdebug 
    LLVM:          supported, not enabled.
    GC:            sgen
However the output of pkg-config mono-2 --libs is:
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
This one I'm not so sure how to solve since there doesn't seem anything called mono-2 on my machine at all.
Hi Matt,
I seem to remember having this issue, but I am not positive what I did to
fix it. Do you have pkg-config installed through homebrew? If not, try that.
Brian
On Sun, May 11, 2014 at 4:32 PM, Matt Ball [email protected] wrote:
Thanks for getting back to me @tjanczuk https://github.com/tjanczuk.
Initially mono -V output the following:
Mono JIT compiler version 3.2.6 ((no/9b58377 Thu Jan 16 17:49:56 EST 2014)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: normal
SIGSEGV: altstack
Notification: kqueue
Architecture: x86
Disabled: none
Misc: softdebug
LLVM: yes(3.3svn-mono-(no/8bdedb5)
GC: sgenSo which is my regular mono installation I guess. So I messed around with
my path to ensure that mono -V then output:Mono JIT compiler version 3.4.0 (tarball Sat 10 May 2014 13:47:19 BST)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: normal
SIGSEGV: altstack
Notification: kqueue
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgenHowever the output of pkg-config mono-2 --libs is:
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' foundThis one I'm not so sure how to solve since there doesn't seem anything
called mono-2 on my machine at all.—
Reply to this email directly or view it on GitHubhttps://github.com/tjanczuk/edge/issues/134#issuecomment-42783989
.
Hmm. Looks like you have pkg-config installed. It worries me that the previous installation of Mono may be affecting things. Did you try uninstalling mono completely using the instructions on the site? Can you try that and then re-building Mono x64 using the brew formula?
@tjanczuk I sure will - that'll be a lunchtime project today :)
@bmavity I'll try completely removing mono, and putting the brew version back on first - and then give that a shot. 
Okay so I removed the _official_ mono package from my machine using the uninstall instructions/script on the mono website - and deleted the output from the last mono 64 brew formula.
Run the mono 64 brew formula again - which completed in 10 minutes without error, and is on my path again as above.
Tried to install edge again - and get the very same error as above. Again when I run pkg-config mono-2 --libs I get the same,
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
Just out of interest it seems that pkg-config --version outputs 0.28 - does that seem correct? Shall I try @bmavity's suggestion?
I also have the 0.28 version and it works.
Do you have /usr/local/lib/pkgconfig directory? Does it have mono-2.pc file or link in it? What's the content?
@tjanczuk thanks for patience and sticking with this - no doubt this is all simply a lack of knowledge about the MacOS environment and tooling.
Yes I have /usr/local/lib/pkgconfig and it does indeed contain mono-2.pc.
I noted a suggestion in the error that I should try adding this path to my PKG_CONFIG_PATH environment variable. When I ran echo $PKG_CONFIG_PATH it was empty. So I ran export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig and confirmed with another echo.
I then ran the edge install again... still no joy.
I searched google a little for some info on PKG_CONFIG_PATH, and somebody on a SO thread suggested running pkg-config --variable pc_path pkg-config to check where pkg-config was looking... which resulted in:
/opt/local/lib/pkgconfig:/opt/local/share/pkgconfig
...which obviously doesn't contain the value I just put onto the PKG_CONFIG_PATH env variable.
I am not very familiar with this system either, but I think you may be onto something. In my case this command actually does return
/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig:/usr/local/Library/ENV/pkgconfig/10.9
where the first path contains the mono-2.pc file. Can you try using pkg-config to actually set the value of pc_path of the pkg-config component itself to contain that path?
We have lift-off! :)
> [email protected] install /Users/matt/Repositories/node-app/node_modules/edge
> node tools/install.js
  CXX(target) Release/obj.target/edge/src/mono/clractioncontext.o
  CXX(target) Release/obj.target/edge/src/mono/clrfunc.o
  CXX(target) Release/obj.target/edge/src/mono/clrfuncinvokecontext.o
  CXX(target) Release/obj.target/edge/src/mono/edge.o
  CXX(target) Release/obj.target/edge/src/mono/monoembedding.o
  CXX(target) Release/obj.target/edge/src/mono/task.o
  CXX(target) Release/obj.target/edge/src/mono/dictionary.o
  CXX(target) Release/obj.target/edge/src/mono/nodejsfunc.o
  CXX(target) Release/obj.target/edge/src/mono/nodejsfuncinvokecontext.o
  CXX(target) Release/obj.target/edge/src/mono/utils.o
  CXX(target) Release/obj.target/edge/src/common/v8synchronizationcontext.o
  SOLINK_MODULE(target) Release/edge.node
  SOLINK_MODULE(target) Release/edge.node: Finished
  ACTION binding_gyp_build_managed_target_compile_mono_embed src/mono/monoembedding.exe
  TOUCH Release/obj.target/build_managed.stamp
[email protected] node_modules/edge
└── [email protected]
So as it turns out I followed @bmavity's advice and installed _pkg-config_ (again, I guess):
brew install pkg-config
Which seems to have put the _newer_ brew install of pkg-config ahead of my previously installed version. When I ran pkg-config --variable pc_path pkg-config again, the correct path for mono-2.pc was in the env variable as required.
One more run of npm install edge and we get a success. Thanks to you both!
As discussed this is already captured in issues for anyone equipped with Google.
For anyone coming across this now, check you haven't got pkg-config installed in /opt/local/bin/ which may well be taking precedence over the brew installed version.
If you have, I fixed it by simply renaming (because I'm a wuss) /opt/local/bin/pkg-config to /opt/local/bin/pkg-config-old and then the brew link to /usr/local/bin/pkg-config worked. 
@jwhitmarsh How do you do this brew link? I have tried with no luck.
I just ran brew link /usr/local/bin/pgk-config/as I said in my comment - presumably you're getting an error? Or did the link work? Check your linked kegs with ls /usr/local/Library/LinkedKegs/, you should see /pkg-config in there
@jwhitmarsh Looked like I did something wrong in the install process. I got pgk-config to work. And, well, mono does not appear to work on osx anyways(https://github.com/tjanczuk/edge/issues/182) :(
It does work mate - I got there in the end. Running OSX 10.10.3, and mono

Ok, I get that too. But I still get No package 'mono-2' found when i run npm install edge. 
I found that running export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig solved my issue :fireworks: 
Here is what helped on my side:
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/Library/Frameworks/Mono.framework/Versions/5.10.1/lib/pkgconfig:$PKG_CONFIG_PATH
Most helpful comment
Here is what helped on my side: