【问题标题】:Zeit now deployment sh: build: command not foundZeit now 部署 sh: build: command not found
【发布时间】:2020-03-15 03:46:51
【问题描述】:

当我尝试将 React 应用程序(打字稿)部署到 zeit 时出现此错误。我正在运行 MacOS Mojave,节点 v12.12.0,npm 6.14.2(但我在项目中使用 yarn,yarn 1.17.3)。它来自一个模板,我只运行yarn 然后now。现在的控制台给了我一个指向这个日志错误的链接。不知道它指的是什么。

sh: build: command not found
Error: Exited with 127
at ChildProcess.<anonymous> (/zeit/ab5350c9de262234/.build-utils/.builder/node_modules/@now/static-build/dist/index.js:33891:24)
at ChildProcess.emit (events.js:223:5)
at ChildProcess.EventEmitter.emit (domain.js:475:20)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
worker exited with code 20 and signal null
Done with "package.json"

package.json 文件:

{
 "name": "@pickbazar/admin",
 "version": "1.0.0",
 "private": true,
 "dependencies": {
   "@apollo/react-hooks": "^3.1.3",
   "apexcharts": "3.8.6",
   "apollo-boost": "^0.4.4",
   "baseui": "^9.40.0",
   "formik": "^2.1.4",
   "fuse.js": "^3.4.6",
   "graphql": "^14.6.0",
   "mobile-detect": "^1.4.4",
   "moment": "^2.24.0",
   "react": "^16.12.0",
   "react-apexcharts": "^1.3.3",
   "react-content-loader": "^5.0.1",
   "react-custom-scrollbars": "^4.2.1",
   "react-dom": "^16.12.0",
   "react-dropzone": "^10.2.1",
   "react-flexbox-grid": "^2.1.2",
   "react-hook-form": "4.9.3",
   "react-image": "^2.4.0",
   "react-moment": "^0.9.6",
   "react-reveal": "^1.2.2",
   "react-router-dom": "^5.1.2",
   "react-scripts": "^3.4.0",
   "styled-components": "^5.0.1",
   "styletron-engine-atomic": "^1.4.5",
   "styletron-react": "^5.2.7",
   "typescript": "^3.7.5",
   "yup": "^0.28.1"
 },

"scripts": {
"start": "react-scripts start",
"admin-dev": "react-scripts start",
"build": "react-scripts build",
"eject": "react-scripts eject",
"serve": "serve -s build"
 },
 "eslintConfig": {
   "extends": "react-app"
 },
 "browserslist": [
   ">0.2%",
   "not dead",
   "not ie <= 11",
   "not op_mini all"
 ],
 "devDependencies": {
   "@types/node": "^13.7.1",
   "@types/react": "^16.9.19",
   "@types/react-dom": "^16.9.5",
   "@types/react-router-dom": "^5.1.2",
   "@types/yup": "^0.26.31"
 }
  }

【问题讨论】:

  • 您的package.json 文件的任何代码?
  • 另外,如果你有,请包括你现在的配置。
  • 你说的是 now.json 吗?

标签: reactjs typescript deployment vercel


【解决方案1】:

试试bash build 或npm run build。

如果您在项目设置中仅输入 build,则会发生该错误。

【讨论】:

  • 我为什么要构建它?我只是尝试部署它,它来自模板。我部署了包/api,工作正常。但是当我尝试部署包/管理员(这是一个仪表板)时,通过输入now 然后它失败了
  • 那么我们真的需要更多信息。当您在zeit.co/blog/advanced-project-settings 上遇到构建配置问题时,您描述的问题很常见
猜你喜欢
  • 2020-09-26
  • 2016-02-24
  • 2011-12-18
  • 2019-05-12
  • 2020-04-22
  • 2017-01-29
  • 1970-01-01
  • 2014-08-10
  • 2020-01-28
相关资源
最近更新 更多