question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cant seem to "sudo npm install -g homebridge"

See original GitHub issue

I’m installing on OS X El Capitan. I installed the npm and node.js from https://nodejs.org/dist/v4.2.6/node-v4.2.6.pkg

I’ve done the suggested chown commands (except the /usr/local) and even ran everything under su.

Below is the output form the install and the debug file.

$sudo npm install -g homebridge

|
> curve25519@1.1.0 install /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/curve25519
> node-gyp rebuild

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
sh: node-gyp: command not found

> ed25519@0.0.3 install /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/ed25519
> node-gyp rebuild

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
sh: node-gyp: command not found

> bignum@0.11.0 install /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/srp/node_modules/bignum
> node-gyp configure build

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
sh: node-gyp: command not found

> mdns@2.2.11 install /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/mdns
> node-gyp rebuild

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
sh: node-gyp: command not found
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "homebridge"
npm ERR! node v4.2.6
npm ERR! npm  v2.14.12
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn

npm ERR! curve25519@1.1.0 install: `node-gyp rebuild`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the curve25519@1.1.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the curve25519 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 curve25519
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/scooter133/npm-debug.log

the nam-debug.log has almost 2500 lines in it though I think the relative part is this:

2389 info install bignum@0.11.0
2390 verbose unsafe-perm in lifecycle false
2391 info bignum@0.11.0 Failed to exec install script
2392 verbose unlock done using /Users/scooter133/.npm/_locks/bignum-4cb6bb7ac0b4952a.lock for /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/srp/node_modules/bignum
2393 verbose about to build /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/srp
2394 verbose unlock done using /Users/scooter133/.npm/_locks/srp-5a99e14b524c4f4f.lock for /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/srp
2395 verbose about to build /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs
2396 verbose unlock done using /Users/scooter133/.npm/_locks/hap-nodejs-ad226527e82daf47.lock     for /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs
2397 verbose about to build /usr/local/lib/node_modules/homebridge
2398 verbose unlock done using /Users/scooter133/.npm/_locks/homebridge-a5618ac2152da688.lock for /usr/local/lib/node_modules/homebridge
2399 verbose stack Error: curve25519@1.1.0 install: `node-gyp rebuild`
2399 verbose stack spawn ENOENT
2399 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:17:16)
2399 verbose stack     at emitTwo (events.js:87:13)
2399 verbose stack     at ChildProcess.emit (events.js:172:7)
2399 verbose stack     at maybeClose (internal/child_process.js:821:16)
2399 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
2400 verbose pkgid curve25519@1.1.0
2401 verbose cwd /Users/scooter133
2402 error Darwin 15.0.0
2403 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "homebridge"
2404 error node v4.2.6
2405 error npm  v2.14.12
2406 error file sh
2407 error code ELIFECYCLE
2408 error errno ENOENT
2409 error syscall spawn
2410 error curve25519@1.1.0 install: `node-gyp rebuild`
2410 error spawn ENOENT
2411 error Failed at the curve25519@1.1.0 install script 'node-gyp rebuild'.
2411 error This is most likely a problem with the curve25519 package,
2411 error not with npm itself.
2411 error Tell the author that this fails on your system:
2411 error     node-gyp rebuild
2411 error You can get their info via:
2411 error     npm owner ls curve25519
2411 error There is likely additional logging output above.
2412 verbose exit [ 1, true ]
2413 verbose unbuild lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/curve25519
2414 info preuninstall curve25519@1.1.0
2415 info uninstall curve25519@1.1.0
2416 verbose unbuild rmStuff curve25519@1.1.0 from /usr/local/lib/node_modules
2417 verbose unbuild rmStuff in /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules
2418 info postuninstall curve25519@1.1.0
2419 silly gentlyRm /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/curve25519 is being purged from base /usr/local
2420 verbose gentlyRm don't care about contents; nuking /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/curve25519
2421 silly vacuum-fs purging /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/curve25519
2422 silly vacuum-fs quitting because other entries in /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
Connor-Knabecommented, Apr 1, 2016

I had the same issue on my RPi. This seemed to fix it for me sudo apt-get install libavahi-compat-libdnssd-dev

1reaction
davispwcommented, Sep 17, 2016

–unsafe-perm fixed it for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Struggling to get started with Homebridge Installation - Reddit
Hello guys. I'm new to this. Trying to install homebridge on my iMac. I have Node.js. I installed in my terminal using sudo...
Read more >
sudo: npm: command not found - node.js - Stack Overflow
The npm file should be in /usr/local/bin/npm . If it's not there, install node.js again with the package on their website. This worked...
Read more >
homebridge - npm
Homebridge is a lightweight NodeJS server you can run on your home network that emulates the iOS HomeKit API. It supports Plugins, which...
Read more >
Homekit-bridged install problem - General - Node-RED Forum
Personally i would uninstall the version you installed with sudo and -g, then install the additional library and then try the command listed...
Read more >
Don't use `sudo` with `npm`. Running sudo npm install - Medium
Running sudo npm install -g seems to be pretty common advice on the Internet. mean.io, a prominent web framework compilation generator/library even suggests ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found