npm install can't access folder (no Permission)

3

i'm trying to install storjshare-daemon on ubuntu and i'm following the guide but when i'm using npm it keeps showing the same error , i try everything like setting public key on github and Check Ownership of the folders and the unsafe flag but it's not working , if anyone tell me what's wrong it wouled help me a lot , thanks .

using : ubuntu 14.04 (server) as root

npm install --global storjshare-daemon

npm ERR! code 128
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b master git://github.com/zipang/daemon.node.git /root/.npm/_cacache/tmp/git-clone-e22442e4
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-e22442e4': Permission denied
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2017-12-26T17_57_58_681Z-debug.log

y.h.

Posted 2017-12-26T20:55:35.007

Reputation: 35

Answers

3

I've just experienced a similar permission problem with a npm install. Even if i created the folder and did chown and chmod, it ended with this permission error.

Here what worked for me:

login as root - sudo su

run npm install command with sudo

Not sure if it's the same problem i had, but worth a try..

pamol

Posted 2017-12-26T20:55:35.007

Reputation: 46

Thank you very much , i can't believe the solution is so simple , i've searched for hours online but all of the answers didn't work , thanks again – y.h. – 2017-12-26T21:39:45.017