KraigM / homebridge-harmonyhub

HomeBridge Plugin for Logitech Harmony Hub
182 stars 52 forks source link

"sudo npm install -g homebridge-harmonyhub" should just work #126

Open David-Noble-at-work opened 6 years ago

David-Noble-at-work commented 6 years ago

I've been looking at the workarounds for this problem and expect I will get one of the two options to work. I do however think that this issue merits attention. Please address this problem:

npm ERR! code 1
npm ERR! Command failed: /opt/local/bin/git clone -q git://github.com/e7hz3r0/harmonyhubjs-client.git /Users/<username>/.npm/_cacache/tmp/git-clone-53f267a7
npm ERR! /Users/<username/.npm/_cacache/tmp/git-clone-53f267a7/.git: Permission denied
npm ERR! 

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/thenobles/.npm/_logs/2018-02-11T22_31_17_776Z-debug.log

Thank you.

felkahlout commented 6 years ago

+1 same issue

tsantos87 commented 6 years ago

+1 same issue

donjohann commented 6 years ago

+1 same issue

rogerioth commented 6 years ago

+1 same issue

to solve this, I had to switch to root, and run everything from there (homebridge, the harmony plugin, etc)

nwoodman commented 6 years ago

https://docs.npmjs.com/getting-started/fixing-npm-permissions. #2 worked for me.

Summary Back-up your computer before you start.

Make a directory for global installations:

mkdir ~/.npm-global Configure npm to use the new directory path:

npm config set prefix '~/.npm-global' Open or create a ~/.profile file and add this line:

export PATH=~/.npm-global/bin:$PATH Back on the command line, update your system variables:

source ~/.profile

recipriversexcluson commented 6 years ago

su -l npm install -g homebridge-harmonyhub

This should do it

DJay-X commented 6 years ago

sudo chown -R $USER /usr/local && npm install homebridge-harmonyhub -g

Worked for me.