简体   繁体   English

如何在 Mac OSX EACCES 上修复:权限被拒绝...您无权访问此文件

[英]How to fix on Mac OSX EACCES: permission denied...You don't have access to this file

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 模板创建一个新项目,在终端 window 中运行命令gatsby new website-public https://github.com/gatsbyjs/gatsby-starter-default ,但我不断收到此错误:

 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 sudo chown -R whoami ~/.npm
  2. sudo chown -R whoami /usr/local/lib/node_modules sudo chown -R whoami /usr/local/lib/node_modules

But nothing helps, I'm using Mac OSX.但没有任何帮助,我使用的是 Mac OSX。

If anyone has some idea, please share.如果有人有什么想法,请分享。

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.错误消息说/Users/delilah/.config/gatsby/config.json是您无权访问的文件,因此这是您必须chown和/或chmod修复的文件,而不是您列出的路径试过了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 您无权在Mac Mojave中保存文件 - You don't have permission to save file in Mac Mojave 您无权访问/在此服务器上 - Mac OS X Mojave上的Apache 2 - You don't have permission to access / on this server - Apache 2 on Mac OS X Mojave Wireshark - 您无权在该设备 mac 上进行捕获 - Wireshark - you don't have permission to capture on that device mac 您无权访问此服务器上的/ project - You don't have permission to access /project on this server 获取:禁止 - 您无权访问此资源 - Getting: Forbidden - You don't have permission to access this resource “您无权访问此资源。” 适用于 Mac OS 11 上 CGI-Executables/ 中的 perl 脚本 - Big Sur - "You don't have permission to access this resource." for perl scripts in CGI-Executables/ on Mac OS 11 - Big Sur Lua文件处理错误:权限被拒绝(Mac OSX Yosemite) - Lua file handling error: Permission Denied (Mac OSX Yosemite) OSX上的AWS Schema Conversion Tool-驱动程序权限-您没有权限 - AWS Schema Conversion Tool on OSX- Driver Permissions - You don't have permission 页面自动化:您没有权限 - Pages automation: You don’t have permission MacOS XAMPP Access Forbidden Error 403 - 您无权访问请求的目录 - MacOS XAMPP Access Forbidden Error 403 - You don't have permission to access the requested directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM