2

I am trying to install on my dependencies from an already existing react project using npm install, however, is giving me this error every time now I try to run npm install.

Does anyone know why is this happening now? I have several projects that I have been working on before installing and uninstalling with no problem at all.

npm WARN deprecated [email protected]: Please update: there are crash fixes npm WARN deprecated [email protected]: use String.prototype.padStart() npm ERR! path /Users/gabrielnessi/.npm/_cacache/index-v5/35/e4/300bcd6d6b07328b3cffb3509f86bc1ac535a870f8fe27c074a299d8c732 npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall open npm ERR! Error: EACCES: permission denied, open '/Users/gabrielnessi/.npm/_cacache/index-v5/35/e4/300bcd6d6b07328b3cffb3509f86bc1ac535a870f8fe27c074a299d8c732' npm ERR! [OperationalError: EACCES: permission denied, open '/Users/gabrielnessi/.npm/_cacache/index-v5/35/e4/300bcd6d6b07328b3cffb3509f86bc1ac535a870f8fe27c074a299d8c732'] { npm ERR! cause: [Error: EACCES: permission denied, open '/Users/gabrielnessi/.npm/_cacache/index-v5/35/e4/300bcd6d6b07328b3cffb3509f86bc1ac535a870f8fe27c074a299d8c732'] { npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'open', npm ERR! path: '/Users/gabrielnessi/.npm/_cacache/index-v5/35/e4/300bcd6d6b07328b3cffb3509f86bc1ac535a870f8fe27c074a299d8c732' npm ERR! }, npm ERR! isOperational: true, npm ERR! stack: 'Error: EACCES: permission denied, open ' + npm ERR! "'/Users/gabrielnessi/.npm/_cacache/index-v5/35/e4/300bcd6d6b07328b3cffb3509f86bc1ac535a870f8fe27c074a299d8c732'", npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'open', npm ERR! path: '/Users/gabrielnessi/.npm/_cacache/index-v5/35/e4/300bcd6d6b07328b3cffb3509f86bc1ac535a870f8fe27c074a299d8c732', npm ERR! parent: 'eslint-plugin-jsx-a11y' npm ERR! } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It is likely you do not have the permissions to access this file as the current user npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator (though this is not recommended). npm ERR! A complete log of this run can be found in: npm ERR! /Users/gabrielnessi/.npm/_logs/2019-06-13T11_28_05_702Z-debug.log``` 
10
  • some dependencies need you to have super user access. Try sudo npm install Commented Jun 13, 2019 at 11:35
  • @MehulMittal this is the second time it happens and first time I solved with sudo yes, but I don't want to be using sudo every time I have to install a package, is there a way to get my permissions right? thanks Commented Jun 13, 2019 at 11:37
  • What is the path of your project Commented Jun 13, 2019 at 11:39
  • @MehulMittal Documents/react_course/react-complete-guide (on macbook) Commented Jun 13, 2019 at 11:42
  • do a npm cache clean or npm cache clean --force if it doesn't work try with sudo. Because most probably your cache is corrupted. Then install the packages. Commented Jun 13, 2019 at 11:46

1 Answer 1

1

You probably create your project as root, and now you try to install module on the same folder as a simple user. You need to login as root to give permissions to user, or change the folder owner or delete and recreate your project folder

Sign up to request clarification or add additional context in comments.

1 Comment

Right. More on this, just add your user to as the owner of /Users/gabrielnessi/.npm/. Try sudo chown -R $USER /Users/gabrielnessi/.npm/. Of course replacing gabrielnessi with your correct username, or the path.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.