Deployment 将react应用程序部署到netlify时生成失败

Deployment 将react应用程序部署到netlify时生成失败,deployment,create-react-app,netlify,Deployment,Create React App,Netlify,我已使用create react app创建了一个react app。 现在我正试图在netlify上部署它,但收到了错误消息 8:16:39 AM: Build ready to start 8:16:40 AM: build-image version: 42bca793ccd33055023c56c4ca8510463a56d317 8:16:40 AM: buildbot version: 6bab8b64bbd90091082af19fedf16bf73d502e5e 8:16:40

我已使用
create react app
创建了一个react app。 现在我正试图在netlify上部署它,但收到了错误消息

8:16:39 AM: Build ready to start
8:16:40 AM: build-image version: 42bca793ccd33055023c56c4ca8510463a56d317
8:16:40 AM: buildbot version: 6bab8b64bbd90091082af19fedf16bf73d502e5e
8:16:40 AM: Fetching cached dependencies
8:16:40 AM: Starting to download cache of 254.7KB
8:16:40 AM: Finished downloading cache in 97.851508ms
8:16:40 AM: Starting to extract cache
8:16:40 AM: Failed to fetch cache, continuing with build
8:16:40 AM: Starting to prepare the repo for build
8:16:41 AM: No cached dependencies found. Cloning fresh repo
8:16:41 AM: git clone git@bitbucket.org:ampcomeiot/iot-web-app
8:16:43 AM: Preparing Git Reference refs/heads/master
8:16:44 AM: Starting build script
8:16:44 AM: Installing dependencies
8:16:45 AM: Downloading and installing node v8.12.0...
8:16:45 AM: Downloading https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-x64.tar.xz...
8:16:45 AM: 0.6
8:16:45 AM: %
8:16:45 AM: 
###
8:16:45 AM:                                       4.8%
8:16:45 AM: 
#####################################
8:16:45 AM:                                      52.0%
8:16:45 AM: 
####################################
8:16:45 AM: #################################### 100.0%
8:16:45 AM: Computing checksum with sha256sum
8:16:46 AM: Checksums matched!
8:16:48 AM: Now using node v8.12.0 (npm v6.4.1)
8:16:48 AM: Attempting ruby version 2.3.6, read from environment
8:16:49 AM: Using ruby version 2.3.6
8:16:49 AM: Using PHP version 5.6
8:16:49 AM: Started restoring cached node modules
8:16:49 AM: Finished restoring cached node modules
8:16:49 AM: Started restoring cached yarn cache
8:16:49 AM: Finished restoring cached yarn cache
8:16:49 AM: Installing yarn at version 1.3.2
8:16:49 AM: Installing Yarn!
8:16:49 AM: > Downloading tarball...
8:16:49 AM: [1/2]: https://yarnpkg.com/downloads/1.3.2/yarn-v1.3.2.tar.gz --> /tmp/yarn.tar.gz.x4SAX8ROjQ
8:16:49 AM:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
8:16:49 AM:                                  Dload  Upload   Total   Spent    Left  Speed
8:16:49 AM: 
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
8:16:49 AM: 
100    91  100    91    0     0    470
8:16:49 AM:      0 --:--:-- --:--:-- --:--:--   471
8:16:49 AM: 
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--
8:16:49 AM:      0
  0     0    0   608    0     0   1456      0 --:--:-- --:--:-- --:--:-- 60800
8:16:50 AM: 
100  865k  100  865k    0     0   897k      0 --:--:-- --:--:-- --:--:--  897k
8:16:50 AM: [2/2]: https://yarnpkg.com/downloads/1.3.2/yarn-v1.3.2.tar.gz.asc --> /tmp/yarn.tar.gz.x4SAX8ROjQ.asc
8:16:50 AM: 
100    95  100    95    0     0   1891
8:16:50 AM:    0 --:--:-- --:--:-- --:--:--  1891
8:16:50 AM: 
  0     0    0   612    0     0   3928      0 --:--:-- --:--:-- --:--:--  3928
8:16:50 AM: 
100  1027  100  1027    0     0   4858      0 --:--:-
8:16:50 AM: - --:--:-- --:--:--  4858
8:16:50 AM: > Verifying integrity...
8:16:50 AM: gpg: Signature made Thu 02 Nov 2017 04:44:10 PM UTC using RSA key ID FD2497F5
8:16:50 AM: gpg: Good signature from "Yarn Packaging <yarn@dan.cx>"
8:16:50 AM: gpg: WARNING: This key is not certified with a trusted signature!
8:16:50 AM: gpg:          There is no indication that the signature belongs to the owner.
8:16:50 AM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907  BBB7 1646 B01B 86E5 0310
8:16:50 AM:      Subkey fingerprint: 6A01 0C51 6600 6599 AA17  F081 46C2 130D FD24 97F5
8:16:50 AM: > GPG signature looks good
8:16:50 AM: > Extracting to ~/.yarn...
8:16:50 AM: > Adding to $PATH...
8:16:50 AM: > We've added the following to your /opt/buildhome/.profile
8:16:50 AM: > If this isn't the profile of your current shell then please add the following to your correct profile:
8:16:50 AM: export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
8:16:50 AM: 
8:16:51 AM: > Successfully installed Yarn 1.3.2! Please open another terminal where the `yarn` command will now be available.
8:16:51 AM: Installing NPM modules using Yarn version 1.3.2
8:16:52 AM: yarn install v1.3.2
8:16:52 AM: [1/5] Validating package.json...
8:16:52 AM: error enery-iot-app@1.0.0: The engine "node" is incompatible with this module. Expected version "10.11.0".
8:16:52 AM: error enery-iot-app@1.0.0: The engine "yarn" is incompatible with this module. Expected version "1.10.1".
8:16:52 AM: error Found incompatible module
8:16:52 AM: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
8:16:52 AM: Error during Yarn install
8:16:52 AM: Error running command: Build script returned non-zero exit code: 1
8:16:52 AM: Failing build: Failed to build site
8:16:52 AM: failed during stage 'building site': Build script returned non-zero exit code: 1
8:16:52 AM: Finished processing build request in 12.384456438s
不确定构建失败的原因,因为我还提到了引擎,并在package.json文件中指定了节点、npm和thread版本

即使它安装的节点版本是v8。
请帮助我解决此问题,因为我无法解决。

包.json
中,您需要
npm
节点
纱线
的引擎版本

  "engines": {
    "npm": "6.4.1",
    "node": "10.11.0",
    "yarn": "1.10.1"
  },
上述输出中Netlify上安装的版本:

在1.3.2版安装纱线

现在使用节点v8.12.0(npm v6.4.1)

确保这些版本是必需的,然后可以在存储库根目录下的项目中设置by

netlify.toml

[build.environment]
NODE_VERSION=“10.11.0”
纱线版本=“1.10.1”
NPM_VERSION=“6.4.1”
  "engines": {
    "npm": "6.4.1",
    "node": "10.11.0",
    "yarn": "1.10.1"
  },