New CI=true build configuration, "Treating warnings as errors because process.env.CI = true"

Hiya @rob @rajhanskumarseo and @elchaparrito1 ! Sorry to hear about the trouble.

Please link us to deploys where you are having trouble so we can take a look.

@elchaparrito1 your problem is different than the topic of this thread:

9:32:23 AM: npm ERR! path /opt/build/repo/package.json    

…which makes me think you cannot build locally either - npm doesn’t work without a package.json and this error says there is no package.json. Looking at your repo, I think you need to set a “base” directory of “pfn”, since this is where your package.json is.

Hey @fool , look at below added logs.

12:30:15 AM: Build ready to start
12:30:17 AM: build-image version: 3031d4c9e432fd7016f6279fc9ad706f9205d845
12:30:17 AM: build-image tag: v3.3.17
12:30:17 AM: buildbot version: 1f35b3abd6e2bf5230d8edf68072840fdec1513f
12:30:17 AM: Fetching cached dependencies
12:30:18 AM: Starting to download cache of 250.9MB
12:30:30 AM: Finished downloading cache in 12.222311333s
12:30:30 AM: Starting to extract cache
12:30:41 AM: Finished extracting cache in 11.501110472s
12:30:41 AM: Finished fetching cache in 23.780886183s
12:30:41 AM: Starting to prepare the repo for build
12:30:42 AM: Preparing Git Reference refs/heads/master
12:30:44 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: ‘build’ versus ‘build/’ in the Netlify UI
12:30:44 AM: Starting build script
12:30:44 AM: Installing dependencies
12:30:44 AM: Python version set to 2.7
12:30:44 AM: Started restoring cached node version
12:30:50 AM: Finished restoring cached node version
12:30:51 AM: v10.21.0 is already installed.
12:30:51 AM: Now using node v10.21.0 (npm v6.14.4)
12:30:51 AM: Started restoring cached build plugins
12:30:51 AM: Finished restoring cached build plugins
12:30:52 AM: Attempting ruby version 2.6.2, read from environment
12:30:53 AM: Using ruby version 2.6.2
12:30:53 AM: Using PHP version 5.6
12:30:53 AM: 5.2 is already installed.
12:30:53 AM: Using Swift version 5.2
12:30:53 AM: Started restoring cached node modules
12:30:53 AM: Finished restoring cached node modules
12:30:53 AM: Installing NPM modules using NPM version 6.14.4
12:31:00 AM: npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
12:31:01 AM: npm WARN deprecated core-js@1.2.7: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
12:31:26 AM: npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
12:31:27 AM: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
12:31:27 AM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
12:31:37 AM: npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
12:31:37 AM: npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
12:31:49 AM: npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
12:31:59 AM: npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
12:32:24 AM: npm WARN rm not removing /opt/build/repo/node_modules/.bin/jest as it wasn’t installed by /opt/build/repo/node_modules/jestnpm WARN rm not removing /opt/build/repo/node_modules/.bin/rimraf as it wasn’t installed by /opt/build/repo/node_modules/rimrafnpm WARN rm not removing /opt/build/repo/node_modules/.bin/semver as it wasn’t installed by /opt/build/repo/node_modules/semvernpm WARN rm not removing /opt/build/repo/node_modules/.bin/json5 as it wasn’t installed by /opt/build/repo/node_modules/json5
12:32:24 AM: > core-js@2.6.11 postinstall /opt/build/repo/node_modules/babel-runtime/node_modules/core-js
12:32:24 AM: > node -e “try{require(’./postinstall’)}catch(e){}”
12:32:24 AM: > core-js@3.6.5 postinstall /opt/build/repo/node_modules/react-app-polyfill/node_modules/core-js
12:32:24 AM: > node -e “try{require(’./postinstall’)}catch(e){}”
12:32:26 AM: npm notice created a lockfile as package-lock.json. You should commit this file.
12:32:26 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.7 (node_modules/react-scripts/node_modules/fsevents):
12:32:26 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.0.7: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
12:32:26 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/jest-haste-map/node_modules/fsevents):
12:32:26 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
12:32:26 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents):
12:32:26 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
12:32:26 AM: npm WARN notsup Unsupported engine for watchpack-chokidar2@2.0.0: wanted: {“node”:"<8.10.0"} (current: {“node”:“10.21.0”,“npm”:“6.14.4”})
12:32:26 AM: npm WARN notsup Not compatible with your version of node/npm: watchpack-chokidar2@2.0.0
12:32:26 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/watchpack/node_modules/chokidar/node_modules/fsevents):
12:32:26 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
12:32:26 AM: npm WARN bootstrap@4.4.1 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
12:32:26 AM: npm WARN react-radio-button-group@1.2.8 requires a peer of react@^15.4.1 but none is installed. You must install peer dependencies yourself.
12:32:26 AM: npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
12:32:26 AM: added 281 packages from 177 contributors, removed 260 packages, updated 1338 packages and audited 1623 packages in 91.526s
12:32:27 AM: 47 packages are looking for funding
12:32:27 AM: run npm fund for details
12:32:27 AM: found 3 vulnerabilities (1 low, 2 moderate)
12:32:27 AM: run npm audit fix to fix them, or npm audit for details
12:32:27 AM: NPM modules installed
12:32:28 AM: Started restoring cached go cache
12:32:28 AM: Finished restoring cached go cache
12:32:28 AM: Installing Go version 1.12
12:32:33 AM: unset GOOS;
12:32:33 AM: unset GOARCH;
12:32:33 AM: export GOROOT=’/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64’;
12:32:33 AM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:{PATH}"; 12:32:33 AM: go version >&2; 12:32:33 AM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env" 12:32:33 AM: go version go1.12 linux/amd64 12:32:33 AM: Installing missing commands 12:32:33 AM: Verify run directory 12:32:34 AM: ​ 12:32:34 AM: ┌─────────────────────────────┐ 12:32:34 AM: │ Netlify Build │ 12:32:34 AM: └─────────────────────────────┘ 12:32:34 AM: ​ 12:32:34 AM: ❯ Version 12:32:34 AM: @netlify/build 2.0.10 12:32:34 AM: ​ 12:32:34 AM: ❯ Flags 12:32:34 AM: deployId: 5ef645bff14c750007b37094 12:32:34 AM: mode: buildbot 12:32:34 AM: ​ 12:32:34 AM: ❯ Current directory 12:32:34 AM: /opt/build/repo 12:32:34 AM: ​ 12:32:34 AM: ❯ Config file 12:32:34 AM: No config file was defined: using default values. 12:32:34 AM: ​ 12:32:34 AM: ❯ Context 12:32:34 AM: production 12:32:34 AM: ​ 12:32:34 AM: ┌────────────────────────────────┐ 12:32:34 AM: │ 1. Build command from settings │ 12:32:34 AM: └────────────────────────────────┘ 12:32:34 AM: ​ 12:32:34 AM: CI= yarn build
12:32:34 AM: bash: yarn: command not found
12:32:34 AM: ​
12:32:34 AM: ┌─────────────────────────────┐
12:32:34 AM: │ “build.command” failed │
12:32:34 AM: └─────────────────────────────┘
12:32:34 AM: ​
12:32:34 AM: Error message
12:32:34 AM: Command failed with exit code 127: CI= yarn build
12:32:34 AM: ​
12:32:34 AM: Error location
12:32:34 AM: In Build command from settings:
12:32:34 AM: CI= yarn build
12:32:34 AM: ​
12:32:34 AM: Resolved config
12:32:34 AM: build:
12:32:34 AM: command: CI= yarn build
12:32:34 AM: publish: /opt/build/repo/build
12:32:34 AM: Caching artifacts
12:32:34 AM: Started saving node modules
12:32:34 AM: Finished saving node modules
12:32:34 AM: Started saving build plugins
12:32:34 AM: Finished saving build plugins
12:32:34 AM: Started saving pip cache
12:32:41 AM: Finished saving pip cache
12:32:41 AM: Started saving emacs cask dependencies
12:32:41 AM: Finished saving emacs cask dependencies
12:32:41 AM: Started saving maven dependencies
12:32:41 AM: Finished saving maven dependencies
12:32:41 AM: Started saving boot dependencies
12:32:41 AM: Finished saving boot dependencies
12:32:41 AM: Started saving go dependencies
12:32:43 AM: Finished saving go dependencies
12:32:43 AM: Error running command: Build script returned non-zero exit code: 1
12:32:43 AM: Failing build: Failed to build site
12:32:43 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 1
12:32:43 AM: Finished processing build request in 2m25.996062862s

Thanks @fool. I got so far into the weeds of the issue, I didn’t look closely at the error pertaining to the file structure.

Here’s the problem:

We do not install yarn for you unless:

  • there is a yarn.lock file in the root of the repo (xor in your base directory, if set!)
  • you have a yarn dependency in package.json which is in the root of your repo (xor your base directory, if set).

Adding CI= npm run build does not work for me. Also tried with the empty env variable. Anyone using vue-cli with the same issue? Thanks!

8:03:12 PM: > vue-cli-service build 8:03:13 PM: - Building for production... 8:03:17 PM: ERROR Failed to compile with 1 errors6:03:17 PM 8:03:17 PM: error in ./src/main.js 8:03:17 PM: Module build failed (from ./node_modules/thread-loader/dist/cjs.js): 8:03:17 PM: Thread Loader (Worker 0) 8:03:17 PM: [BABEL] /opt/build/repo/src/main.js: Cannot find module '@babel/compat-data/corejs3-shipped-proposals'

Hi, @dbarcosb, I see that error in the site builds but it doesn’t appear to be related to CI=true in any way.

The error appears similar to this:

I would recommend testing that solution, quoting:

For those babel users who are affected by this issue after upgrading to node.js 13.13/12.17, please upgrade @babel/preset-env to 7.9.0.

Please let us know if it works (or not) and/or if there are other questions.

1 Like

Hi @luke, thanks for your answer! I am editing my first reply because this actually worked, the problem was there. Investigated with other threads and finally it worked, thanks!