Failed during stage 'building site': Build script returned non-zero exit code: 1 (https://ntl.fyi/exit-code-1)

Hi! I’m trying to deploy a Vue Js App saved on a Git Hub Repo. When I start the deploy, I get this error below:
9:33:13 PM: gyp ERR! build error
9:33:13 PM: gyp ERR! stack Error: make failed with exit code: 2
9:33:13 PM: gyp ERR! stack at ChildProcess.onExit (/opt/build/repo/node_modules/node-gyp/lib/build.js:262:23)
9:33:13 PM: gyp ERR! stack at ChildProcess.emit (node:events:513:28)
9:33:13 PM: gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
9:33:13 PM: gyp ERR! System Linux 5.4.196-108.356.amzn2.x86_64
9:33:13 PM: gyp ERR! command β€œ/opt/buildhome/.nvm/versions/node/v16.17.0/bin/node” β€œ/opt/build/repo/node_modules/node-gyp/bin/node-gyp.js” β€œrebuild” β€œβ€“verbose” β€œβ€“libsass_ext=” β€œβ€“libsass_cflags=” β€œβ€“libsass_ldflags=” β€œβ€“libsass_library=”
9:33:13 PM: gyp ERR! cwd /opt/build/repo/node_modules/node-sass
9:33:13 PM: gyp ERR! node -v v16.17.0
9:33:13 PM: gyp ERR! node-gyp -v v3.8.0
9:33:13 PM: gyp ERR! not ok
9:33:13 PM: Build failed with error code: 1
9:33:13 PM: Error during Yarn install
9:33:13 PM: Build was terminated: Build script returned non-zero exit code: 1
9:33:13 PM: Creating deploy upload records
9:33:13 PM: Failing build: Failed to build site
9:33:13 PM: Failed during stage β€˜building site’: Build script returned non-zero exit code: 1 (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
9:33:13 PM: Finished processing build request in 1m56.233332357s

My repository on Git Hub is this: GitHub - GuilhermeHSalviano/addressForm: The project is basically a form when you get your address based on the cep number
By the way I’m sure the build command is making a Index.html file. I’ve also searched for similar erros but none of the posts I found had a solution that worked for me.

Hi @GuilhermeSalviano

In this case it is due to the node-sass dependency "node-sass": "^4.12.0". This version of node-sass is not compatible with node v16 (see: this post.)

I did a downgrade of node, with an eviroment variable ( NODE_VERSION to v14.17.5), and I had this error:

7:52:41 PM: error busca_cep@0.1.0: The engine β€œnode” is incompatible with this module. Expected version β€œ16.x”. Got β€œ14.17.5”
7:52:41 PM: error Found incompatible module
7:52:41 PM: Creating deploy upload records
7:52:41 PM: info Visit yarn install | Yarn for documentation about this command.
7:52:41 PM: Error during Yarn install
7:52:41 PM: Build was terminated: Build script returned non-zero exit code: 1
7:52:41 PM: Failing build: Failed to build site
7:52:41 PM: Failed during stage β€˜building site’: Build script returned non-zero exit code: 1 (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
7:52:41 PM: Finished processing build request in 8.067371249s

Should I try another version of Node?

This module (busca_cep) requires node v16, while the node-sass version requires v14.

You will need to upgrade node-sass (which my require upgrading other dependencies, e.g. sass-loader) to a version compatible with node v16.

See

Edit: I see the name is busca_cep. And in the package.json are the lines:

  "engines": {
    "node": "16.x"
  },

which is why node v16 is expected.

I’m sorry to insist. I update all my dev dependencies in package.json, as you can see in my repo. I was able to do the deploy and a site was generated. But I got a 404 error. This is the link generated:
https://62fd76be30df892590ad8a39--adorable-marzipan-7fcefa.netlify.app/
And this is the log:
$ npm run build
8:17:46 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
8:17:46 PM: npm WARN config location in the cache, and they are managed by
8:17:46 PM: npm WARN config cacache.
8:17:46 PM: > busca_cep@0.1.0 build
8:17:46 PM: > vue-cli-service build
8:17:46 PM: All browser targets in the browserslist configuration have supported ES module.
8:17:46 PM: Therefore we don’t build two separate bundles for differential loading.
8:17:46 PM: - Building for production…
8:17:50 PM: WARNING Compiled with 1 warning11:17:50 PM
8:17:50 PM: [eslint]
8:17:50 PM: /opt/build/repo/src/App.vue
8:17:50 PM: 67:20 warning Unexpected console statement no-console
8:17:50 PM: Creating deploy upload records
8:17:50 PM:
8:17:50 PM: :heavy_multiplication_x: 1 problem (0 errors, 1 warning)
8:17:50 PM:
8:17:50 PM: You may use special comments to disable some warnings.
8:17:50 PM: Use // eslint-disable-next-line to ignore the next line.
8:17:50 PM: Starting post processing
8:17:50 PM: Use /* eslint-disable */ to ignore all warnings in a file.
8:17:50 PM: File Size Gzipped
8:17:50 PM: dist/js/chunk-vendors.0f2412e2.js 59.58 KiB 22.81 KiB
8:17:50 PM: dist/js/app.e50e2471.js 4.74 KiB 1.89 KiB
8:17:51 PM: Post processing - HTML
8:17:50 PM: dist/css/app.ff4c6eca.css 0.34 KiB 0.17 KiB
8:17:50 PM: Images and other types of assets omitted.
8:17:50 PM: Build at: 2022-08-17T23:17:50.629Z - Hash: 5957d9d1a4c6035d - Time: 3046ms
8:17:50 PM: DONE Build complete. The dist directory is ready to be deployed.
8:17:51 PM: Post processing - header rules
8:17:50 PM: INFO Check out deployment instructions at Deployment | Vue CLI
8:17:50 PM: ​
8:17:50 PM: (build.command completed in 4.4s)
8:17:50 PM: ​
8:17:51 PM: Post processing - redirect rules
8:17:50 PM: ────────────────────────────────────────────────────────────────
8:17:50 PM: 2. Deploy site
8:17:50 PM: ────────────────────────────────────────────────────────────────
8:17:51 PM: Post processing done
8:17:50 PM: ​
8:17:50 PM: Starting to deploy site from β€˜dist’
8:17:50 PM: Creating deploy tree
8:17:50 PM: 0 new files to upload
8:17:50 PM: 0 new functions to upload
8:17:50 PM: Site deploy was successfully initiated
8:17:50 PM: ​
8:17:50 PM: (Deploy site completed in 172ms)
8:17:50 PM: ​
8:17:50 PM: ────────────────────────────────────────────────────────────────
8:17:50 PM: Netlify Build Complete
8:17:50 PM: ────────────────────────────────────────────────────────────────
8:17:50 PM: ​
8:17:50 PM: (Netlify Build completed in 4.6s)
8:17:51 PM: Caching artifacts
8:17:51 PM: Started saving node modules
8:17:51 PM: Finished saving node modules
8:17:51 PM: Started saving build plugins
8:17:51 PM: Finished saving build plugins
8:17:51 PM: Started saving yarn cache
8:17:53 PM: Finished saving yarn cache
8:17:53 PM: Started saving pip cache
8:17:53 PM: Finished saving pip cache
8:17:53 PM: Started saving emacs cask dependencies
8:17:53 PM: Finished saving emacs cask dependencies
8:17:53 PM: Started saving maven dependencies
8:17:53 PM: Finished saving maven dependencies
8:17:53 PM: Started saving boot dependencies
8:17:53 PM: Finished saving boot dependencies
8:17:53 PM: Started saving composer dependencies
8:17:53 PM: Finished saving composer dependencies
8:17:53 PM: Started saving rust rustup cache
8:17:53 PM: Finished saving rust rustup cache
8:17:53 PM: Started saving go dependencies
8:17:53 PM: Finished saving go dependencies
8:17:53 PM: Build script success
8:17:54 PM: Uploading Cache of size 214.2MB
8:17:54 PM: Site is live :sparkles:
8:17:56 PM: Finished processing build request in 41.772444198s

I upgraded all dev dependencies of package.json and it seemed to work. The deploy was made successfully, but when the link is generated, I get a 404 error. This is the link:
https://62fd79b8024daf2632d2cc09--adorable-marzipan-7fcefa.netlify.app/
This is the ending part of the log:
$ npm run build

8:29:43 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special

8:29:43 PM: npm WARN config location in the cache, and they are managed by

8:29:43 PM: npm WARN config cacache.

8:29:43 PM: > busca_cep@0.1.0 build

8:29:43 PM: > vue-cli-service build

8:29:43 PM: All browser targets in the browserslist configuration have supported ES module.

8:29:43 PM: Therefore we don’t build two separate bundles for differential loading.

8:29:43 PM: - Building for production…

8:29:47 PM: WARNING Compiled with 1 warning11:29:47 PM

8:29:47 PM: [eslint]

8:29:47 PM: /opt/build/repo/src/App.vue

8:29:47 PM: 67:20 warning Unexpected console statement no-console

8:29:47 PM: Creating deploy upload records

8:29:47 PM:

8:29:47 PM: :heavy_multiplication_x: 1 problem (0 errors, 1 warning)

8:29:47 PM:

8:29:47 PM: You may use special comments to disable some warnings.

8:29:47 PM: Use // eslint-disable-next-line to ignore the next line.

8:29:47 PM: Starting post processing

8:29:47 PM: Use /* eslint-disable */ to ignore all warnings in a file.

8:29:47 PM: File Size Gzipped

8:29:47 PM: dist/js/chunk-vendors.0f2412e2.js 59.58 KiB 22.81 KiB

8:29:47 PM: Post processing - HTML

8:29:47 PM: dist/js/app.e50e2471.js 4.74 KiB 1.89 KiB

8:29:47 PM: dist/css/app.ff4c6eca.css 0.34 KiB 0.17 KiB

8:29:47 PM: Images and other types of assets omitted.

8:29:47 PM: Post processing - header rules

8:29:47 PM: Build at: 2022-08-17T23:29:47.117Z - Hash: 5957d9d1a4c6035d - Time: 2949ms

8:29:47 PM: DONE Build complete. The dist directory is ready to be deployed.

8:29:47 PM: INFO Check out deployment instructions at Deployment | Vue CLI

8:29:47 PM: Post processing - redirect rules

8:29:47 PM: ​

8:29:47 PM: (build.command completed in 4.3s)

8:29:47 PM: ​

8:29:47 PM: Post processing done

8:29:47 PM: ────────────────────────────────────────────────────────────────

8:29:47 PM: 2. Deploy site

8:29:47 PM: ────────────────────────────────────────────────────────────────

8:29:47 PM: ​

8:29:47 PM: Starting to deploy site from β€˜dist’

8:29:47 PM: Creating deploy tree

8:29:47 PM: 0 new files to upload

8:29:47 PM: 0 new functions to upload

8:29:47 PM: Site deploy was successfully initiated

8:29:47 PM: ​

8:29:47 PM: (Deploy site completed in 193ms)

8:29:47 PM: ​

8:29:47 PM: ────────────────────────────────────────────────────────────────

8:29:47 PM: Netlify Build Complete

8:29:47 PM: ────────────────────────────────────────────────────────────────

8:29:47 PM: ​

8:29:47 PM: (Netlify Build completed in 4.5s)

8:29:47 PM: Caching artifacts

8:29:47 PM: Started saving node modules

8:29:47 PM: Finished saving node modules

8:29:47 PM: Started saving build plugins

8:29:47 PM: Finished saving build plugins

8:29:47 PM: Started saving yarn cache

8:29:50 PM: Finished saving yarn cache

8:29:50 PM: Started saving pip cache

8:29:50 PM: Finished saving pip cache

8:29:50 PM: Started saving emacs cask dependencies

8:29:50 PM: Finished saving emacs cask dependencies

8:29:50 PM: Started saving maven dependencies

8:29:50 PM: Finished saving maven dependencies

8:29:50 PM: Started saving boot dependencies

8:29:50 PM: Finished saving boot dependencies

8:29:50 PM: Started saving composer dependencies

8:29:50 PM: Finished saving composer dependencies

8:29:50 PM: Started saving rust rustup cache

8:29:50 PM: Finished saving rust rustup cache

8:29:50 PM: Site is live :sparkles:

8:29:50 PM: Started saving go dependencies

8:29:50 PM: Finished saving go dependencies

8:29:50 PM: Build script success

8:29:51 PM: Uploading Cache of size 292.5MB

8:29:53 PM: Finished processing build request in 55.244288357s

Inside <head> is <link rel="icon" href="/busca-cep/favicon.ico">

This is incorrect because the site it deployed at the domain root. Remove publicPath: '/busca-cep' from vue.config.js.

It worked! Thank you so much!!!

1 Like

So glad everything is working now, @GuilhermeSalviano :tada:

Thanks, @coelmay !!!

Excellent news @GuilhermeSalviano!

As always @hillary :smiley: