Q&A
実現したいこと
% gatsby --help を実行して正常に実行できるようにしたい。
前提
発生している問題・エラーメッセージ
エラーメッセージ
% gatsby --help
zsh: command not found: gatsby
~ % npm config delete prefix
~ % npm config set prefix /usr/local
~ % npm i -g gatsby-cli
/usr/local/bin/gatsby -> /usr/local/lib/node_modules/gatsby-cli/cli.js
gatsby-cli@5.7.0 postinstall /usr/local/lib/node_modules/gatsby-cli
node scripts/postinstall.js
npm WARN notsup Unsupported engine for gatsby-cli@5.7.0: wanted: {"node":">=18.0.0"} (current: {"node":"12.14.0","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: gatsby-cli@5.7.0
npm WARN notsup Unsupported engine for fs-extra@11.1.0: wanted: {"node":">=14.14"} (current: {"node":"12.14.0","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: fs-extra@11.1.0
npm WARN notsup Unsupported engine for gatsby-core-utils@4.7.0: wanted: {"node":">=18.0.0"} (current: {"node":"12.14.0","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: gatsby-core-utils@4.7.0
npm WARN notsup Unsupported engine for gatsby-telemetry@4.7.0: wanted: {"node":">=18.0.0"} (current: {"node":"12.14.0","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: gatsby-telemetry@4.7.0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @lmdb/lmdb-darwin-arm64@2.5.3 (node_modules/gatsby-cli/node_modules/lmdb/node_modules/@lmdb/lmdb-darwin-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @lmdb/lmdb-darwin-arm64@2.5.3: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @lmdb/lmdb-linux-x64@2.5.3 (node_modules/gatsby-cli/node_modules/lmdb/node_modules/@lmdb/lmdb-linux-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @lmdb/lmdb-linux-x64@2.5.3: wanted {"os":"linux","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @lmdb/lmdb-linux-arm64@2.5.3 (node_modules/gatsby-cli/node_modules/lmdb/node_modules/@lmdb/lmdb-linux-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @lmdb/lmdb-linux-arm64@2.5.3: wanted {"os":"linux","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @lmdb/lmdb-linux-arm@2.5.3 (node_modules/gatsby-cli/node_modules/lmdb/node_modules/@lmdb/lmdb-linux-arm):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @lmdb/lmdb-linux-arm@2.5.3: wanted {"os":"linux","arch":"arm"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @lmdb/lmdb-win32-x64@2.5.3 (node_modules/gatsby-cli/node_modules/lmdb/node_modules/@lmdb/lmdb-win32-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @lmdb/lmdb-win32-x64@2.5.3: wanted {"os":"win32","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @msgpackr-extract/msgpackr-extract-win32-x64@3.0.2 (node_modules/gatsby-cli/node_modules/msgpackr-extract/node_modules/@msgpackr-extract/msgpackr-extract-win32-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @msgpackr-extract/msgpackr-extract-win32-x64@3.0.2: wanted {"os":"win32","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @msgpackr-extract/msgpackr-extract-linux-x64@3.0.2 (node_modules/gatsby-cli/node_modules/msgpackr-extract/node_modules/@msgpackr-extract/msgpackr-extract-linux-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @msgpackr-extract/msgpackr-extract-linux-x64@3.0.2: wanted {"os":"linux","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @msgpackr-extract/msgpackr-extract-linux-arm64@3.0.2 (node_modules/gatsby-cli/node_modules/msgpackr-extract/node_modules/@msgpackr-extract/msgpackr-extract-linux-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @msgpackr-extract/msgpackr-extract-linux-arm64@3.0.2: wanted {"os":"linux","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.2 (node_modules/gatsby-cli/node_modules/msgpackr-extract/node_modules/@msgpackr-extract/msgpackr-extract-darwin-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.2: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @msgpackr-extract/msgpackr-extract-linux-arm@3.0.2 (node_modules/gatsby-cli/node_modules/msgpackr-extract/node_modules/@msgpackr-extract/msgpackr-extract-linux-arm):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @msgpackr-extract/msgpackr-extract-linux-arm@3.0.2: wanted {"os":"linux","arch":"arm"} (current: {"os":"darwin","arch":"x64"})
updated 1 package in 39.116s
~ % gatsby --help
internal/modules/cjs/loader.js:800
throw err;
^
Error: Cannot find module 'gatsby-core-utils/is-truthy'
Require stack:
- /usr/local/lib/node_modules/gatsby-cli/lib/reporter/reporter.js
- /usr/local/lib/node_modules/gatsby-cli/lib/reporter/catch-exit-signals.js
- /usr/local/lib/node_modules/gatsby-cli/lib/reporter/index.js
- /usr/local/lib/node_modules/gatsby-cli/lib/create-cli.js
- /usr/local/lib/node_modules/gatsby-cli/lib/index.js
- /usr/local/lib/node_modules/gatsby-cli/cli.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
at Function.Module._load (internal/modules/cjs/loader.js:690:27)
at Module.require (internal/modules/cjs/loader.js:852:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/usr/local/lib/node_modules/gatsby-cli/lib/reporter/reporter.js:19:17)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Module.require (internal/modules/cjs/loader.js:852:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/usr/local/lib/node_modules/gatsby-cli/lib/reporter/reporter.js',
'/usr/local/lib/node_modules/gatsby-cli/lib/reporter/catch-exit-signals.js',
'/usr/local/lib/node_modules/gatsby-cli/lib/reporter/index.js',
'/usr/local/lib/node_modules/gatsby-cli/lib/create-cli.js',
'/usr/local/lib/node_modules/gatsby-cli/lib/index.js',
'/usr/local/lib/node_modules/gatsby-cli/cli.js'
]
}
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
2023/03/28 23:39
2023/03/29 00:17