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.

Getting Permission Denied Error when Installing with NPM

See original GitHub issue
  • Node Version: v8.2.0
  • Npm Version: 5.2.0
  • Platform: Darwin Junies-MacBook-Pro-2.local 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
  • Package Version:

When I run sudo npm install contentful I get the following error:

npm ERR! code 1
npm ERR! Command failed: /usr/local/bin/git clone --depth=1 -q -b fix/https-via-http-proxy git:// /Users/juniethreatt/.npm/_cacache/tmp/git-clone-e4d5168e
npm ERR! /Users/juniethreatt/.npm/_cacache/tmp/git-clone-e4d5168e/.git: Permission denied
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/juniethreatt/.npm/_logs/2017-11-30T21_24_50_080Z-debug.log

I previously have "contentful": "^4.3.0", installed, but while trying to update other node packages, I got that error and now it seems it’s not installed at all anymore

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

sdelvalle57commented, Oct 4, 2018

I did sudo npm cache clean -f

For me that did the trick

axe312gercommented, Dec 7, 2017

Sounds like a problem related to your machine for me. Also, you should never use sudo in combination with npm. I’d guess your file permissions are broken in your npm folder, you may try:

  • delete your npm cache
  • reset the permissions of your /Users/juniethreatt/.npm/ recoursively to your user.

See here:

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolving EACCES permissions errors when installing ...
Resolving EACCES permissions errors when installing packages globally · Reinstall npm with a node version manager · Manually change npm's default directory.
Read more >
I get "access denied" on `npm install` - node.js - Stack Overflow
I just super user do it: sudo npm install -g. for global stuff. and just: sudo chown -R [user]:[user] /projects/.
Read more >
Fixing npm permission issue - Kaustubh Talathi - Medium
Run “npm config get prefix” in your terminal. This will give the path of global node_modules: For ex: /usr/local · Change the user...
Read more >
NPM Install - Resolving EACCES Permissions Denied
How to resolve eacces permissions denied when installing npm packages globally. Here's how you solve this issue in a couple of minutes.
Read more >
Fix NPM EACCES permission denied errors ... - YouTube
How to fix eacces permission denied errors with npm when installing a global package using Ubuntu. ... Eacces error with global npm.
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 Post

No results found

github_iconTop Related Hashnode Post

No results found