Search code examples
gitubuntunpmgulpnpm-install

permission denied error with npm install


Just made a fresh reinstall of my ubuntu and installed necessarily things such as nodejs npm. If I cloned project and tried sudo npm install I got this error. Had someone same problem?

using node: 8.9.3 npm: 5.5.1

fetchPackageMetaData error for gulp@git://github.com/gulpjs/gulp.git#4ed9a4a3275559c73a396eff7e1fde3824951ebb Command failed: /usr/bin/git clone -q git://github.com/gulpjs/gulp.git /home/user_name/.npm/_cacache/tmp/git-clone-0e191fc9

fetchPackageMetaData /home/user_name/.npm/_cacache/tmp/git-clone-0e191fc9/.git: Permission denied

Error: Command failed: /usr/bin/git clone -q git://github.com/gulpjs/gulp.git /home/user_name/.npm/_cacache/tmp/git-clone-0e191fc9

/home/user_name/.npm/_cacache/tmp/git-clone-0e191fc9/.git: Permission denied

Solution

  • this solution worked for me

     sudo sudo npm install