Skip to content
This repository has been archived by the owner on Jun 4, 2023. It is now read-only.

Unable to build on OSX 10.11.1 #244

Closed
noizfactory opened this issue Nov 29, 2015 · 14 comments
Closed

Unable to build on OSX 10.11.1 #244

noizfactory opened this issue Nov 29, 2015 · 14 comments

Comments

@noizfactory
Copy link

I was unable to build on El Capitan. I'm attaching the debug log output. Can someone please help?

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the mdns package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls mdns
npm ERR! There is likely additional logging output above.

npm-debug.log.txt

@ricosuave0922
Copy link

same problem here any fix?

@thomascjohnson
Copy link

Me too! I even tried using a docker... didn't work.

@colinrioux
Copy link

I have a fix! Well at least this worked for me. I'll provide step by step on what I did.

First, I looked into issues with node-gyp. I first installed it using npm by doing $ npm install -g node-gyp.
Next, I checked if binding.gyp was in my root folder (open terminal and do $ ls, if it's there then good!) Otherwise, in your root folder, create the binding.gyp like the default given here.
Next, do $ python --version to check your python version. For node-gyp to work, 2.7.x is best. 3.x doesn't work to my knowledge at least. If your version isn't 2.7.x, go here and download 2.7.10 for mac. Follow the instructions. Then re-open terminal and do $ python --version and make sure it is 2.7.10.

From this point, write $ which python to find out where python is located. It should be in /Library/Frameworks/.... Then open the ~/.bash_profile or ~/.bashrc file and add the following lines:

PYTHON=$PYTHON:(insert here the directory given at "which python")
export PYTHON

Then in terminal type $ source ~/.bash_profile or $ source ~/.bashrc. Now we have successfully setup python.

After, we must update the npm config as well to support this. Write the following commands into terminal:

$ npm config set python (insert here the directory given at "which python")
$ npm config set save=true
$ npm config set save-exact=true
$ npm config get 

The final line is just to make sure the settings were inputted into the config.

The final step (you may of have to earlier) is to make sure you have XCode AND XCode Command Line Tools installed. If you don't know how, first install the latest version of XCode from the app store. Next in terminal type $ xcode-build --install. After it has installed make sure to agree to the license by typing $ xcode-build --license.

At this point you should have all of the essential tools to try installing airsonos or any other npm packages that require node-gyp. However, if you are currently in the same boat as I was, please install node-gyp install like so:
In terminal write:

$ npm install -g node-gyp-install
$ node-gyp-install
$ npm install -g airsonos

Essentially what node-gyp-install does is manually install all of the node/iojs header files that are needed for node-gyp to work properly. After I did, as a wrap-up, I had no issue installing airsonos/mdns/all of those npm packages that depend on node-gyp.

This ends my fix. Currently I'm still getting the bug where it either hangs on $ airsonos or it gives me an error regarding bluebird. I don't have fixes for that but hopefully soon.

@ricosuave0922
Copy link

I ended up getting it to work without all that hastle and without any python commands or the full XCode. Ill try to backtrack and figure out what i had to do to install it. If i remember correctly, manually installing it rather than using npm was the solution.

I will have to double check the terminal history when i get home, but this looks familiar.

All i had to do was run this command:

sudo npm install -g --unsafe-perm airsonos

@colinrioux
Copy link

Essentially my way is doing it involving npm. Your way is very promising as well, and I agree is probably easier. However, my fix works with all npm packages that require node-gyp rebuild. And example would be mdns.

@benzwu
Copy link

benzwu commented Dec 10, 2015

after all this time... I can't make it work. Now thanks to @colinrioux, it works now. Thanks bro.

just these 3 lines, voilà!

$ npm install -g node-gyp-install
$ node-gyp-install
$ npm install -g airsonos

@benzwu
Copy link

benzwu commented Dec 10, 2015

I have found bluebird error as well on my home setup (thru sonos bridge) but not on my office setup (wired).

/usr/local/lib/node_modules/airsonos/node_modules/bluebird/js/main/promise.js:677
            throw e;
                  ^
Error: Method Not Allowed
    at maybeWrapAsError (/usr/local/lib/node_modules/airsonos/node_modules/bluebird/js/main/util.js:70:12)

@colinrioux
Copy link

I am receiving this error as well... probably first step to try is to unplug the bridge and link a speaker via ethernet (to the back of your router).

If that doesn't work, its best to watch the issues page for possible fixes from people.

@noizfactory
Copy link
Author

Thanks for the solutions guys! I'll give it a go this weekend again. It
seems like post build, there's still some issue connecting to the speakers?
On Thu, 10 Dec 2015 at 7:43 PM, Colin Rioux [email protected]
wrote:

I am receiving this error as well... probably first step to try is to
unplug the bridge and link a speaker via ethernet (to the back of your
router).

If that doesn't work, its best to watch the issues page for possible fixes
from people.


Reply to this email directly or view it on GitHub
#244 (comment).

@benzwu
Copy link

benzwu commented Dec 11, 2015

the bridge is the culprit. after removing the bridge out of the system, it works again. no more bluebird errors

@noizfactory
Copy link
Author

This is great! It installed perfectly after following Colin's instructions. One additional step - if you get an error regarding connection reset then you need to change npm configs to use http instead of https:

npm config set registry http://registry.npmjs.org/

Ironically, SONOS is launching apple music on beta tomorrow. But this is better! :) Cheers everyone for all the help (and to the author for this awesome hack)!

@fourmind
Copy link

@colinrioux, beautiful! Thanks so much!

I couldn't get $ xcode-build --install to work, but was able to download the Xcode Command Line tools and install them separately. For those who hit that, open Xcode, then from the Xcode menu, go to Open Developer Tool and choose More developer tools... to go to a download site.

@maelcum
Copy link

maelcum commented Apr 16, 2016

Getting same error as bezwu and ColinRioux from bluebird when SONOS bridge is installed. Without Bridge no problems but ... alas neither speakers, since those are addressed via the bridge.
Is there a way to exclude the detection of the bridge in bluebird?
Or is my only chance to switch the speakers to WLAN instead of SONOSNet? I preferred the latter as the WiFis around me are disturbing WLAN operations (and thus the speaker operations).

@olets
Copy link

olets commented Aug 3, 2016

I didn't have these installation problems, but @colinrioux did help me realize I didn't have node-gyp installed. This was causing other problems, because things were getting stuck in a temp directory.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants