Reactjs 部署到Netlify时Gatsby构建失败
我目前正试图在登台环境中查看我的站点,因此我正在从登台分支推送。不是大师 它完全建立在本地。当推送到Netlify时,它失败了 下面是我遇到的错误:Reactjs 部署到Netlify时Gatsby构建失败,reactjs,gatsby,netlify,Reactjs,Gatsby,Netlify,我目前正试图在登台环境中查看我的站点,因此我正在从登台分支推送。不是大师 它完全建立在本地。当推送到Netlify时,它失败了 下面是我遇到的错误: 3:31:59 PM: ──────────────────────────────────────────────────────────────── 3:31:59 PM: 1. Build command from Netlify app 3:31:59 PM: ─────────
3:31:59 PM: ────────────────────────────────────────────────────────────────
3:31:59 PM: 1. Build command from Netlify app
3:31:59 PM: ────────────────────────────────────────────────────────────────
3:31:59 PM:
3:31:59 PM: $ gatsby build
3:31:59 PM: bash: gatsby: command not found
3:31:59 PM:
3:31:59 PM: ────────────────────────────────────────────────────────────────
3:31:59 PM: "build.command" failed
3:31:59 PM: ────────────────────────────────────────────────────────────────
3:31:59 PM:
3:31:59 PM: Error message
3:31:59 PM: Command failed with exit code 127: gatsby build
3:31:59 PM:
3:31:59 PM: Error location
3:31:59 PM: In Build command from Netlify app:
3:31:59 PM: gatsby build
3:31:59 PM:
3:31:59 PM: Resolved config
3:31:59 PM: build:
3:31:59 PM: command: gatsby build
3:31:59 PM: commandOrigin: ui
3:31:59 PM: publish: /opt/build/repo/dist
3:31:59 PM: Caching artifacts
3:31:59 PM: Started saving node modules
3:31:59 PM: Finished saving node modules
3:31:59 PM: Started saving build plugins
3:31:59 PM: Finished saving build plugins
3:31:59 PM: Started saving yarn cache
3:31:59 PM: Finished saving yarn cache
3:31:59 PM: Started saving pip cache
3:31:59 PM: Finished saving pip cache
3:31:59 PM: Started saving emacs cask dependencies
3:31:59 PM: Finished saving emacs cask dependencies
3:31:59 PM: Started saving maven dependencies
3:31:59 PM: Finished saving maven dependencies
3:31:59 PM: Started saving boot dependencies
3:31:59 PM: Finished saving boot dependencies
3:31:59 PM: Started saving go dependencies
3:32:01 PM: Finished saving go dependencies
3:32:04 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:32:04 PM: Failing build: Failed to build site
3:32:04 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
3:32:04 PM: Finished processing build request in 1m17.166375156s
您得到的错误是,
gatsby
CLI不可用
bash:gatsby:未找到命令
gatsby
。请注意,它不能出现在您的devdependency中warn build
或npm run build
)。这将确保您使用的是node_模块中包含的可执行文件,而不是全局可用的工具您得到的错误是,
gatsby
CLI不可用
bash:gatsby:未找到命令
gatsby
。请注意,它不能出现在您的devdependency中warn build
或npm run build
)。这将确保您使用的是node_模块中包含的可执行文件,而不是全局可用的工具