npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

Error while installing dependencies for react/truffle project

Unhandled rejection Error: Command failed: /usr/bin/git clone --depth=1 -q -b master /root/.npm/_cacache/tmp/git-clone-61ad0ac4
/root/.npm/_cacache/tmp/git-clone-61ad0ac4/.git: Permission denied

at ChildProcess.exithandler (child_process.js:291:12)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:961:16)
at (internal/child_process.js:380:11)
at Socket.emit (events.js:182:13)
at Pipe._handle.close [as _onclose] (net.js:595:12)

npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-08-02T14_31_10_564Z-debug.log

What I Wanted to Do

I was installing dependencies of a project using npm install, when this error appeared suggesting the error should be reported.

What Happened Instead


This is the project from which I was installing the dependencies:

$ npm : 6.2.0

this looks like a permissions issue from running as root or something