React App构建在IBM Cloud Foundry上失败

时间:2018-11-12 13:50:04

标签: reactjs ibm-cloud

我有一个React应用程序,并使用命令行将其推送到IBM Cloud Foundry,但是在构建应用程序时会引发以下错误:-

package.json [服务器]

    {
      "name": "data-cap",
      "license" : "UNLICENSED",
      "version": "1.0.0",
      "scripts": {
        "client": "cd client && yarn start",
        "server": "node server.js",
        "dev": "concurrently --kill-others-on-fail \"yarn server\" \"yarn client\""
      },
      "dependencies": {
        "concurrently": "^3.6.1",
        "bindings": "^1.3.0",
        "body-parser": "^1.18.3",
        "dotenv": "^6.0.0",
        "express": "^4.16.3",
        "form-data": "^2.3.2",
        "mysql": "^2.16.0",
        "request": "^2.88.0",
        "yarn": "^1.9.4"
      },
      "devDependencies": {
        "concurrently": "^3.6.1"
      },
      "engines": {
        "node": "8.9.4",
        "npm": "5.6.0"
      }
    }

package.json [客户端]

        {
          "name": "data-cap",
          "version": "0.1.0",
          "private": true,
          "proxy": "http://localhost:5000/",
          "dependencies": {
            "react": "^16.4.2",
            "react-dom": "^16.4.2",
            "react-router-dom": "^4.3.1",
            "react-scripts": "1.1.5"
          },
          "scripts": {
            "start": "react-scripts start",
            "build": "react-scripts build",
            "test": "react-scripts test --env=jsdom",
            "eject": "react-scripts eject"
          }
        }

错误日志

   2018-11-12T13:34:04.79+0000 [CELL/0] OUT Cell 721b91cc-ebdc-4c3b-9e0c-46fcd50d8cc6 creating container for instance cec333ca-ec1c-45b0-56de-23ed
   2018-11-12T13:34:05.46+0000 [CELL/0] OUT Cell e1658841-c1c6-4272-9f70-97c48483163c successfully destroyed container for instance 28e343dd-cce2-4158-4470-b2ae
   2018-11-12T13:34:07.02+0000 [CELL/0] OUT Cell 721b91cc-ebdc-4c3b-9e0c-46fcd50d8cc6 successfully created container for instance cec333ca-ec1c-45b0-56de-23ed
   2018-11-12T13:34:12.87+0000 [CELL/0] OUT Starting health monitoring of container
   2018-11-12T13:34:15.15+0000 [APP/PROC/WEB/0] OUT yarn run v1.9.4
   2018-11-12T13:34:15.66+0000 [APP/PROC/WEB/0] OUT $ concurrently --kill-others-on-fail "yarn server" "yarn client"
   2018-11-12T13:34:18.87+0000 [APP/PROC/WEB/0] OUT [0] $ node server.js
   2018-11-12T13:34:18.87+0000 [APP/PROC/WEB/0] OUT [1] $ cd client && yarn start
   2018-11-12T13:34:21.53+0000 [APP/PROC/WEB/0] OUT [0] Listening on port 8080
   2018-11-12T13:34:22.01+0000 [APP/PROC/WEB/0] OUT [1] $ react-scripts start
   2018-11-12T13:34:22.30+0000 [APP/PROC/WEB/0] OUT [1] /bin/sh: 1: react-scripts: not found
   2018-11-12T13:34:22.35+0000 [APP/PROC/WEB/0] OUT [1] error Command failed with exit code 127.
   2018-11-12T13:34:22.35+0000 [APP/PROC/WEB/0] OUT [1] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
   2018-11-12T13:34:22.51+0000 [APP/PROC/WEB/0] OUT [1] error Command failed with exit code 1.
   2018-11-12T13:34:22.51+0000 [APP/PROC/WEB/0] OUT [1] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
   2018-11-12T13:34:22.60+0000 [APP/PROC/WEB/0] OUT [1] yarn client exited with code 1
   2018-11-12T13:34:22.60+0000 [APP/PROC/WEB/0] OUT --> Sending SIGTERM to other processes..
   2018-11-12T13:34:22.63+0000 [CELL/0] OUT Container became healthy
   2018-11-12T13:34:22.81+0000 [APP/PROC/WEB/0] OUT [0] yarn server exited with code null
   2018-11-12T13:34:22.87+0000 [APP/PROC/WEB/0] ERR error Command failed with exit code 1.
   2018-11-12T13:34:22.87+0000 [APP/PROC/WEB/0] OUT info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
   2018-11-12T13:34:23.08+0000 [APP/PROC/WEB/0] OUT Exit status 1
   2018-11-12T13:34:23.11+0000 [CELL/SSHD/0] OUT Exit status 0
   2018-11-12T13:34:26.37+0000 [API/16] OUT Process has crashed with type: "web"
   2018-11-12T13:34:26.39+0000 [API/16] OUT App instance exited with guid 6d46b91f-08c4-48e3-95f1-9f011430c2b0 payload: {"instance"=>"cec333ca-ec1c-45b0-56de-23ed", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"APP/PROC/WEB: Exited with status 1", "crash_count"=>3, "crash_timestamp"=>1542029666325673715, "version"=>"f41432df-4a31-45d0-8554-8e62e12b87e0"}
   2018-11-12T13:34:28.91+0000 [CELL/0] OUT Cell 721b91cc-ebdc-4c3b-9e0c-46fcd50d8cc6 stopping instance cec333ca-ec1c-45b0-56de-23ed
   2018-11-12T13:34:28.91+0000 [CELL/0] OUT Cell 721b91cc-ebdc-4c3b-9e0c-46fcd50d8cc6 destroying container for instance cec333ca-ec1c-45b0-56de-23ed
   2018-11-12T13:34:29.47+0000 [PROXY/0] OUT Exit status 137

任何帮助和建议都非常欢迎。我的客户端和服务器都在同一个项目文件夹中。我也在使用yarn来构建项目。当我在本地系统上构建并运行项目时。我没有任何错误。

0 个答案:

没有答案