Home > Blockchain >  How to fix on Mac OSX EACCES: permission denied...You don't have access to this file
How to fix on Mac OSX EACCES: permission denied...You don't have access to this file

Time:11-30

I'm trying to make a new project with gatsby template running the command gatsby new website-public https://github.com/gatsbyjs/gatsby-starter-default in Terminal window, but I constantly getting this error:

 gatsby new website-public https://github.com/gatsbyjs/gatsby-starter-default
Error: EACCES: permission denied, open '/Users/delilah/.config/gatsby/config.json'
You don't have access to this file.

    at Object.openSync (node:fs:585:3)
    at Object.readFileSync (node:fs:453:35)
    at Ti._i.globalConfigPath.get all [as all] (/usr/local/lib/node_modules/gatsby-cli/node_modules/create-gatsby/lib/index.js:1:155965)
    at new Ti._i.globalConfigPath (/usr/local/lib/node_modules/gatsby-cli/node_modules/create-gatsby/lib/index.js:1:155924)
    at Ti (/usr/local/lib/node_modules/gatsby-cli/node_modules/create-gatsby/lib/index.js:1:155721)
    at Object.<anonymous> (/usr/local/lib/node_modules/gatsby-cli/node_modules/create-gatsby/lib/index.js:1:486075)
    at Module._compile (node:internal/modules/cjs/loader:1095:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1147:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)

I have tried with following:

  1. sudo chown -R whoami ~/.npm
  2. sudo chown -R whoami /usr/local/lib/node_modules

But nothing helps, I'm using Mac OSX.

If anyone has some idea, please share.

CodePudding user response:

The error message says that /Users/delilah/.config/gatsby/config.json is the file you don't have access to, so that's the file you have to chown and/or chmod to fix, not paths you list as having tried.

  • Related