0

网站链接 - https://react-chat-page.netlify.app/

github - https://github.com/mrshawnhum/chat-app

构建错误

我最近添加了一个重定向文件来修复刷新站点时的错误,并在我的项目中添加了使用 netlify-cli 的自动部署。我第一次添加 Yarn Run Build 并在尝试部署时收到退出代码 127。我在 netlify 上手动将其更改为 Yarn Build,但仍然收到相同的消息。我还尝试清除缓存并手动部署站点,但仍然收到相同的消息。

  "name": "client",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.3.2",
    "@testing-library/user-event": "^7.1.2",
    "font-awesome": "^4.7.0",
    "netlify-cli": "^2.58.0",
    "query-string": "^6.13.1",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-emoji": "^0.5.0",
    "react-router": "^5.2.0",
    "react-router-dom": "^5.2.0",
    "react-scripts": "3.4.1",
    "react-scroll-to-bottom": "^3.0.0",
    "socket.io-client": "^2.3.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "postbuild": "cp_redirects ./build/",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}
4

1 回答 1

0

默认情况下,Netlify 将从您的 git 存储库的根文件夹开始构建,其中没有您的 package.json 文件,因此 Netlify 不知道如何运行yarn.

您可以在 UI 设置中更改它,请参见此处

于 2020-07-24T14:08:15.587 回答