我正在嘗試使用 gatsby 模板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)
我嘗試過以下操作:
- 須藤 chown -R
whoami~/.npm - 須藤 chown -R
whoami/usr/local/lib/node_modules
但沒有任何幫助,我使用的是 Mac OSX。
如果有人有任何想法,請分享。
uj5u.com熱心網友回復:
錯誤訊息說這/Users/delilah/.config/gatsby/config.json是您無權訪問的檔案,因此這是您必須chown和/或chmod修復的檔案,而不是您列出的已嘗試路徑。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/370245.html
上一篇:npmci的pnpm等效命令
