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

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!

I’m still getting an error even after editing my build command settings

3:04:08 PM: Build ready to start
3:04:09 PM: build-image version: ca811f47d4c1cbd1812d1eb6ecb0c977e86d1a1d
3:04:09 PM: build-image tag: v3.3.20
3:04:09 PM: buildbot version: 78b5536ab4f742c26705d3e953381b9cde6e22ef
3:04:10 PM: Fetching cached dependencies
3:04:10 PM: Failed to fetch cache, continuing with build
3:04:10 PM: Starting to prepare the repo for build
3:04:10 PM: No cached dependencies found. Cloning fresh repo
3:04:10 PM: git clone GitHub - tattooseoul/ouitresjolie_1
3:04:11 PM: Preparing Git Reference refs/heads/master
3:04:12 PM: Starting build script
3:04:12 PM: Installing dependencies
3:04:12 PM: Python version set to 2.7
3:04:13 PM: v12.18.0 is already installed.
3:04:14 PM: Now using node v12.18.0 (npm v6.14.4)
3:04:14 PM: Started restoring cached build plugins
3:04:14 PM: Finished restoring cached build plugins
3:04:14 PM: Attempting ruby version 2.7.1, read from environment
3:04:16 PM: Using ruby version 2.7.1
3:04:16 PM: Using PHP version 5.6
3:04:16 PM: 5.2 is already installed.
3:04:16 PM: Using Swift version 5.2
3:04:16 PM: Started restoring cached node modules
3:04:16 PM: Finished restoring cached node modules
3:04:16 PM: Started restoring cached yarn cache
3:04:16 PM: Finished restoring cached yarn cache
3:04:16 PM: Installing yarn at version 1.22.4
3:04:16 PM: Installing Yarn!
3:04:16 PM: > Downloading tarball…
3:04:16 PM: [1/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz → /tmp/yarn.tar.gz.JaBDhdIiX0
3:04:16 PM: % Total % Received % Xferd Average Speed Time Time Time Current
3:04:16 PM: Dload Upload Total Spent Left Speed
3:04:16 PM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
3:04:16 PM: 100 80 100 80 0 0 287 0 --:–:-- --:–:-- --:–:-- 287
3:04:17 PM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
3:04:17 PM: 100 93 100 93 0 0 155 0 --:–:-- --:–:-- --:–:-- 577
3:04:17 PM: 100 630 100 630 0 0 710 0 --:–:-- --:–:-- --:–:-- 710
3:04:17 PM: 100 1215k 100 1215k 0 0 928k 0 0:00:01 0:00:01 --:–:-- 928k
3:04:17 PM: [2/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc → /tmp/yarn.tar.gz.JaBDhdIiX0.asc
3:04:17 PM: 100 84 100 84 0 0 3108 0 --:–:-- --:–:-- --:–:-- 3108
3:04:17 PM: 100 97 100 97 0 0 1786 0 --:–:-- --:–:-- --:–:-- 1786
3:04:17 PM: 100 634 100 634 0 0 7313 0 --:–:-- --:–:-- --:–:-- 7313
3:04:17 PM: 0 1028 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
3:04:17 PM: 100 1028 100 1028 0 0 8042 0 --:–:-- --:–:-- --:–:-- 1003k
3:04:18 PM: > Verifying integrity…
3:04:18 PM: gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID
3:04:18 PM: gpg: Good signature from “Yarn Packaging yarn@dan.cx
3:04:18 PM: gpg: WARNING: This key is not certified with a trusted signature!
3:04:18 PM: gpg: There is no indication that the signature belongs to the owner.
3:04:18 PM: Primary key fingerprint:
3:04:18 PM:
3:04:18 PM: > GPG signature looks good
3:04:18 PM: > Extracting to ~/.yarn…
3:04:18 PM: > Adding to $PATH…
3:04:18 PM: > Successfully installed Yarn 1.22.4! Please open another terminal where the yarn command will now be available.
3:04:18 PM: Installing NPM modules using Yarn version 1.22.4
3:04:19 PM: yarn install v1.22.4
3:04:19 PM: warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
3:04:19 PM: [1/4] Resolving packages…
3:04:20 PM: warning @gridsome/vue-remark > @gridsome/source-filesystem > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
3:04:20 PM: warning @gridsome/vue-remark > @gridsome/transformer-remark > unified > @types/vfile > @types/vfile-message@2.0.0: This is a stub types definition. vfile-message provides its own type definitions, so you do not need this installed.
3:04:24 PM: [2/4] Fetching packages…
3:04:24 PM: warning Pattern [“vscode-textmate@GitHub - octref/vscode-textmate: A library that helps tokenize text using Text Mate grammars.”] is trying to unpack in the same destination “/opt/build/.yarn_cache/v6/npm-vscode-textmate-4.0.1-e65aabe2227febda7beaad31dd0fca1228c5ddf3/node_modules/vscode-textmate” as pattern [“vscode-textmate@git+https://github.com/octref/vscode-textmate.git”]. This could result in non-deterministic behavior, skipping.
3:04:30 PM: warning mini-css-extract-plugin@0.5.0: Invalid bin field for “mini-css-extract-plugin”.
3:04:30 PM: warning url-loader@1.1.2: Invalid bin field for “url-loader”.
3:04:40 PM: info fsevents@1.2.13: The platform “linux” is incompatible with this module.
3:04:40 PM: info “fsevents@1.2.13” is an optional dependency and failed compatibility check. Excluding it from installation.
3:04:40 PM: info fsevents@2.1.3: The platform “linux” is incompatible with this module.
3:04:40 PM: info “fsevents@2.1.3” is an optional dependency and failed compatibility check. Excluding it from installation.
3:04:40 PM: [3/4] Linking dependencies…
3:04:40 PM: warning “gridsome-plugin-remark-shiki > shiki > onigasm > tslint@5.20.1” has unmet peer dependency “typescript@>=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev”.
3:04:40 PM: warning “gridsome-plugin-remark-shiki > shiki > onigasm > tslint > tsutils@2.29.0” has unmet peer dependency “typescript@>=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev”.
3:04:40 PM: warning “gridsome-plugin-remark-shiki > shiki-languages > vscode-textmate@4.0.1” has unmet peer dependency “oniguruma@^7.0.0”.
3:04:40 PM: warning “gridsome-plugin-remark-shiki > shiki-languages > vscode-textmate@4.0.1” has unmet peer dependency “onigasm@^2.1.0”.
3:04:40 PM: warning “gridsome-plugin-remark-shiki > shiki > shiki-themes > vscode-textmate@4.0.1” has unmet peer dependency “oniguruma@^7.0.0”.
3:04:40 PM: warning " > vue-fuse@2.2.1" has unmet peer dependency “vue@^2.6.10”.
3:04:47 PM: [4/4] Building fresh packages…
3:04:50 PM: success Saved lockfile.
3:04:50 PM: Done in 31.27s.
3:04:50 PM: NPM modules installed using Yarn
3:04:51 PM: Started restoring cached go cache
3:04:51 PM: Finished restoring cached go cache
3:04:51 PM: go version go1.14.4 linux/amd64
3:04:51 PM: go version go1.14.4 linux/amd64
3:04:51 PM: Installing missing commands
3:04:51 PM: Verify run directory
3:04:52 PM: ​
3:04:52 PM: ┌─────────────────────────────┐
3:04:52 PM: │ Netlify Build │
3:04:52 PM: └─────────────────────────────┘
3:04:52 PM: ​
3:04:52 PM: ❯ Version
3:04:52 PM: @netlify/build 2.0.27
3:04:52 PM: ​
3:04:52 PM: ❯ Flags
3:04:52 PM: deployId: 5f1050476066b00009a7a632
3:04:52 PM: mode: buildbot
3:04:52 PM: ​
3:04:52 PM: ❯ Current directory
3:04:52 PM: /opt/build/repo
3:04:52 PM: ​
3:04:52 PM: ❯ Config file
3:04:52 PM: /opt/build/repo/netlify.toml
3:04:52 PM: ​
3:04:52 PM: ❯ Context
3:04:52 PM: production
3:04:52 PM: ​
3:04:52 PM: ┌────────────────────────────────────┐
3:04:52 PM: │ 1. build.command from netlify.toml │
3:04:52 PM: └────────────────────────────────────┘
3:04:52 PM: ​
3:04:52 PM: $ CI= npm run build
3:04:52 PM: > base@ build /opt/build/repo
3:04:52 PM: > gridsome build
3:04:53 PM: Gridsome v0.7.19
3:04:53 PM: Initializing plugins…
3:04:54 PM: Load sources - 0.02s
3:04:54 PM: Create GraphQL schema - 0.06s
3:04:54 PM: Create pages and templates - 0.02s
3:04:54 PM: Generate temporary code - 0.03s
3:04:54 PM: Bootstrap finish - 1.37s
3:04:54 PM: Compiling assets…
3:05:08 PM: Compile assets - 14.13s
3:05:08 PM: Execute GraphQL (3 queries) - 0s
3:05:08 PM: Render HTML (3 files) - 0.29s
3:05:08 PM: Process files (0 files) - 0s
3:05:09 PM: Processing images (9 images) - 0%Processing images (9 images) - 100%Process images (9 images) - 0.96s
3:05:09 PM: Error: Sitemap plugin is missing a required siteUrl config.
3:05:09 PM: at /opt/build/repo/node_modules/@gridsome/plugin-sitemap/index.js:15:13
3:05:09 PM: at Plugins.run (/opt/build/repo/node_modules/gridsome/lib/app/Plugins.js:141:17)
3:05:09 PM: at async module.exports (/opt/build/repo/node_modules/gridsome/lib/build.js:42:3)
3:05:10 PM: npm ERR! code ELIFECYCLE
3:05:10 PM: npm ERR! errno 1
3:05:10 PM: npm ERR! base@ build: gridsome build
3:05:10 PM: npm ERR! Exit status 1
3:05:10 PM: npm ERR!
3:05:10 PM: npm ERR! Failed at the base@ build script.
3:05:10 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
3:05:10 PM: npm ERR! A complete log of this run can be found in:
3:05:10 PM: npm ERR! /opt/buildhome/.npm/_logs/2020-07-16T13_05_10_513Z-debug.log
3:05:10 PM: ​
3:05:10 PM: ┌─────────────────────────────┐
3:05:10 PM: │ “build.command” failed │
3:05:10 PM: └─────────────────────────────┘
3:05:10 PM: ​
3:05:10 PM: Error message
3:05:10 PM: Command failed with exit code 1: CI= npm run build
3:05:10 PM: ​
3:05:10 PM: Error location
3:05:10 PM: In build.command from netlify.toml:
3:05:10 PM: CI= npm run build
3:05:10 PM: ​
3:05:10 PM: Resolved config
3:05:10 PM: build:
3:05:10 PM: command: CI= npm run build
3:05:10 PM: commandOrigin: config
3:05:10 PM: publish: /opt/build/repo/dist
3:05:10 PM: Caching artifacts
3:05:10 PM: Started saving node modules
3:05:10 PM: Finished saving node modules
3:05:10 PM: Started saving build plugins
3:05:10 PM: Finished saving build plugins
3:05:10 PM: Started saving yarn cache
3:05:10 PM: Finished saving yarn cache
3:05:10 PM: Started saving pip cache
3:05:10 PM: Finished saving pip cache
3:05:10 PM: Started saving emacs cask dependencies
3:05:10 PM: Finished saving emacs cask dependencies
3:05:10 PM: Started saving maven dependencies
3:05:10 PM: Finished saving maven dependencies
3:05:10 PM: Started saving boot dependencies
3:05:10 PM: Finished saving boot dependencies
3:05:10 PM: Started saving go dependencies
3:05:10 PM: Finished saving go dependencies
3:05:13 PM: Error running command: Build script returned non-zero exit code: 1
3:05:13 PM: Failing build: Failed to build site
3:05:13 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 1
3:05:13 PM: Finished processing build request in 1m3.582997458s

I also tried to edit my package.json file with “CI= npm run build” but still not working…

Can you build locally? This quote from your logs makes me think you cannot, or that you do not have netlify configured identically to your local build environment. This failure is not related to our build system, but to your code:

Problem solved! Fixing the sitemap error did the trick.

For the record, I didn’t have to set the build command to “CI= npm run build”. A standard “gridsome build” command worked.

Thank you.

1 Like

Hi Netlify Team,

Why is that only “CI = npm run build” works fine for me and not “CI = yarn build” even when my default build script is “yarn build”? Pardon my ignorance, I expected “CI = yarn build” to also work fine since “yarn build” is the equivalence of “npm run build”.

Hi @techiesodiq,

Just to confirm, you’re using CI= yarn build? Note the lack of space between CI and =.

Thanks for the correction about the omission. I never knew that space matters. Mind you, what I used was “CI = npm run build” with the space and it worked. Meanwhile, are you saying that “CI= yarn build” too will work?

That’s strange. From what I remember CI = npm run build never worked, the space was always a problem. I can’t find a thread at the moment where I had corrected someone using space, but yeah, even the docs don’t use space:

CI=false npm run build

Worked for me

1 Like

Hi guys, can someone help me?

My build commands is, CI=false yarn build

I keep getting the same error, already try it change to CI= npm run build, npm build, yarn build…

Hey there, @fdevos1 :wave:

Can you share your full deploy log as well as a link to your site please? Thanks!

Sure

https://suspicious-bohr-3acb41.netlify.app

10:59:17 AM: Build ready to start
10:59:18 AM: build-image version: c6001ed68662a13e5deb24abec2b46058c58248a
10:59:18 AM: build-image tag: v3.9.0
10:59:18 AM: buildbot version: 29fef7ab5dc568ca81434ff0643fc14ddc7b88ab
10:59:19 AM: Fetching cached dependencies
10:59:19 AM: Starting to download cache of 807.0MB
10:59:23 AM: Finished downloading cache in 3.935226948s
10:59:23 AM: Starting to extract cache
10:59:51 AM: Finished extracting cache in 28.558113439s
10:59:51 AM: Finished fetching cache in 32.657957407s
10:59:51 AM: Starting to prepare the repo for build
10:59:52 AM: Preparing Git Reference refs/heads/master
10:59:54 AM: Parsing package.json dependencies
10:59:54 AM: Starting build script
10:59:54 AM: Installing dependencies
10:59:54 AM: Python version set to 2.7
10:59:55 AM: Started restoring cached node version
10:59:58 AM: Finished restoring cached node version
10:59:58 AM: v12.18.0 is already installed.
10:59:59 AM: Now using node v12.18.0 (npm v6.14.4)
10:59:59 AM: Started restoring cached build plugins
10:59:59 AM: Finished restoring cached build plugins
10:59:59 AM: Attempting ruby version 2.7.2, read from environment
11:00:00 AM: Using ruby version 2.7.2
11:00:01 AM: Using PHP version 5.6
11:00:01 AM: Started restoring cached yarn cache
11:00:19 AM: Finished restoring cached yarn cache
11:00:20 AM: No yarn workspaces detected
11:00:20 AM: Started restoring cached node modules
11:00:20 AM: Finished restoring cached node modules
11:00:20 AM: Installing NPM modules using Yarn version 1.22.10
11:00:21 AM: yarn install v1.22.10
11:00:21 AM: [1/4] Resolving packages…
11:00:22 AM: [2/4] Fetching packages…
11:00:24 AM: info @netlify/routing-local-proxy-darwin-arm64@0.30.2: The platform “linux” is incompatible with this module.
11:00:24 AM: info “@netlify/routing-local-proxy-darwin-arm64@0.30.2” is an optional dependency and failed compatibility check. Excluding it from installation.
11:00:24 AM: info @netlify/routing-local-proxy-darwin-arm64@0.30.2: The CPU architecture “x64” is incompatible with this module.
11:00:24 AM: info @netlify/routing-local-proxy-darwin-x64@0.30.2: The platform “linux” is incompatible with this module.
11:00:24 AM: info “@netlify/routing-local-proxy-darwin-x64@0.30.2” is an optional dependency and failed compatibility check. Excluding it from installation.
11:00:24 AM: info @netlify/routing-local-proxy-win32-x64@0.30.2: The platform “linux” is incompatible with this module.
11:00:24 AM: info “@netlify/routing-local-proxy-win32-x64@0.30.2” is an optional dependency and failed compatibility check. Excluding it from installation.
11:00:24 AM: info fsevents@2.3.2: The platform “linux” is incompatible with this module.
11:00:24 AM: info “fsevents@2.3.2” is an optional dependency and failed compatibility check. Excluding it from installation.
11:00:24 AM: info fsevents@1.2.13: The platform “linux” is incompatible with this module.
11:00:24 AM: info “fsevents@1.2.13” is an optional dependency and failed compatibility check. Excluding it from installation.
11:00:24 AM: [3/4] Linking dependencies…
11:00:24 AM: warning " > react-lottie@1.2.3" has incorrect peer dependency “react@^0.14.7 || ^15.0.0 || ^16.0.0”.
11:00:24 AM: warning “react-outside-click-handler > airbnb-prop-types@2.16.0” has incorrect peer dependency “react@^0.14 || ^15.0.0 || ^16.0.0-alpha”.
11:00:24 AM: warning " > styled-components@5.3.1" has unmet peer dependency “react-is@>= 16.8.0”.
11:00:24 AM: warning " > @testing-library/user-event@12.8.3" has unmet peer dependency “@testing-library/dom@>=7.21.4”.
11:00:32 AM: [4/4] Building fresh packages…
11:00:32 AM: success Saved lockfile.
11:00:32 AM: Done in 10.93s.
11:00:32 AM: NPM modules installed using Yarn
11:00:32 AM: Started restoring cached go cache
11:00:32 AM: Finished restoring cached go cache
11:00:32 AM: go version go1.14.4 linux/amd64
11:00:32 AM: go version go1.14.4 linux/amd64
11:00:32 AM: Installing missing commands
11:00:32 AM: Verify run directory
11:00:34 AM: ​
11:00:34 AM: ────────────────────────────────────────────────────────────────
11:00:34 AM: Netlify Build
11:00:34 AM: ────────────────────────────────────────────────────────────────
11:00:34 AM: ​
11:00:34 AM: ❯ Version
11:00:34 AM: @netlify/build 18.13.7
11:00:34 AM: ​
11:00:34 AM: ❯ Flags
11:00:34 AM: baseRelDir: true
11:00:34 AM: buildId: 615b08b45d87521ca8d0675c
11:00:34 AM: deployId: 615b08b45d87521ca8d0675e
11:00:34 AM: ​
11:00:34 AM: ❯ Current directory
11:00:34 AM: /opt/build/repo
11:00:34 AM: ​
11:00:34 AM: ❯ Config file
11:00:34 AM: /opt/build/repo/netlify.toml
11:00:34 AM: ​
11:00:34 AM: ❯ Context
11:00:34 AM: production
11:00:34 AM: ​
11:00:34 AM: ────────────────────────────────────────────────────────────────
11:00:34 AM: 1. Build command from Netlify app
11:00:34 AM: ────────────────────────────────────────────────────────────────
11:00:34 AM: ​
11:00:34 AM: $ CI=false yarn build
11:00:34 AM: yarn run v1.22.11
11:00:34 AM: $ react-scripts build
11:00:36 AM: Creating an optimized production build…
11:01:33 AM: Failed to compile.
11:01:33 AM:
11:01:33 AM: /opt/build/repo/src/components/DocEdit/index.tsx
11:01:33 AM: TypeScript error in /opt/build/repo/src/components/DocEdit/index.tsx(204,23):
11:01:33 AM: Argument of type ‘string’ is not assignable to parameter of type ‘never’. TS2345
11:01:33 AM: 202 | value={createNotification}
11:01:33 AM: 203 | maxLength={55}
11:01:33 AM: > 204 | {…register(“notification_text”)}
11:01:33 AM: | ^
11:01:33 AM: 205 | />
11:01:33 AM: 206 |
11:01:33 AM: 207 |
11:01:33 AM: error Command failed with exit code 1.
11:01:33 AM: info Visit yarn run | Yarn for documentation about this command.
11:01:33 AM: ​
11:01:33 AM: ────────────────────────────────────────────────────────────────
11:01:33 AM: “build.command” failed
11:01:33 AM: ────────────────────────────────────────────────────────────────
11:01:33 AM: ​
11:01:33 AM: Error message
11:01:33 AM: Command failed with exit code 1: CI=false yarn build
11:01:33 AM: ​
11:01:33 AM: Error location
11:01:33 AM: In Build command from Netlify app:
11:01:33 AM: CI=false yarn build
11:01:33 AM: ​
11:01:33 AM: Resolved config
11:01:33 AM: build:
11:01:33 AM: command: CI=false yarn build
11:01:33 AM: commandOrigin: ui
11:01:33 AM: publish: /opt/build/repo/build
11:01:33 AM: publishOrigin: ui
11:01:33 AM: redirects:
11:01:33 AM: - from: ‘*’
11:01:33 AM: status: 200
11:01:33 AM: to: /index.html
11:01:33 AM: redirectsOrigin: config
11:01:33 AM: Caching artifacts
11:01:33 AM: Started saving node modules
11:01:33 AM: Finished saving node modules
11:01:33 AM: Started saving build plugins
11:01:33 AM: Finished saving build plugins
11:01:33 AM: Started saving yarn cache
11:01:50 AM: Finished saving yarn cache
11:01:50 AM: Started saving pip cache
11:01:50 AM: Finished saving pip cache
11:01:50 AM: Started saving emacs cask dependencies
11:01:50 AM: Finished saving emacs cask dependencies
11:01:50 AM: Started saving maven dependencies
11:01:50 AM: Finished saving maven dependencies
11:01:50 AM: Started saving boot dependencies
11:01:50 AM: Finished saving boot dependencies
11:01:50 AM: Started saving rust rustup cache
11:01:50 AM: Finished saving rust rustup cache
11:01:50 AM: Started saving go dependencies
11:01:50 AM: Finished saving go dependencies
11:01:50 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:01:50 AM: Creating deploy upload records
11:01:50 AM: Failing build: Failed to build site
11:01:50 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
11:01:50 AM: Finished processing build request in 2m31.781179656s

hi there, this is an unrelated issue. You have some errors in your code, so we never get to complete the build step. Does this work locally?

Thanks a lot for this ! Got my problem solved so quickly !

1 Like

I do agree with the part about treating warnings as errors. That’s a very fair point. Warnings should generally not ever break stuff.

If it’s an error and a dev is deploying and ignoring errors, then that’s different.

To clarify, it’s not Netlify that’s breaking stuff. It’s your site builder. When it detects a CI environment, it decides to treat warnings and errors. Netlify only adopted to the standards.

A post was split to a new topic: Build failing with v8:Internal error

A post was split to a new topic: CI = npm run build and it did not work

Please post what that solution was next time so it can help others. I’m going through this now and need to know what that solution is.

I assume the solution was CI= npm run build as the build command, since that’s the solution for everyone in this thread?