0

Title speaks for itself mostly.

Upon trying to install bootstrap in my project:

npm i bootstrap@5.2.3

I receive error codes:

npm ERR! syscall open
npm ERR! path /Users/samgoldrick/package.json
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, open '/Users/samgoldrick/package.json'
npm ERR!  [Error: EACCES: permission denied, open '/Users/samgoldrick/package.json'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'open',
npm ERR!   path: '/Users/samgoldrick/package.json'
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.

This is strange because I don't have issues installing npm packages globally but run into issues installing them locally in projects.

Any help appreciated!

EDIT

Complete oversight on my part. I was running commands outside of the project dir accidentally, forgot to cd in using vscode terminal, thanks for the answers regardless.

Sam
  • 65
  • 6
  • You think it's a good idea to install this in the root of you home directory? – derpirscher Apr 23 '23 at 14:26
  • Have you tried the solutions mentioned in https://stackoverflow.com/questions/16151018/how-to-fix-npm-throwing-error-without-sudo?rq=2 – Rukshan Jayasekara Apr 23 '23 at 14:27
  • @derpirscher no, I do not think this a good idea, oversight on my part - I did not cd into the project folder and now I feel stupid – Sam Apr 23 '23 at 14:33
  • 1
    @RukshanJayasekara thanks for the suggestion, I solved my issue, just lack of attention to detail on my part running commands in vscode outside of the project folder accidentally! – Sam Apr 23 '23 at 14:34

0 Answers0