netlify deployment: Failed during stage 'building site': Build script returned non-zero exit code: 2
I found the same error when trying to deploy my single-page React JS web applications to Netlify.
Following is the procedure I followed to solve the issue and successfully deploy the site.
Go to Site Settings.
Select Build & Deploy dropdown from the menu.
Select Continuous Deployment tab from the dropdown.
Under the section Build Settings, Select Edit settings.
- Change the build command as
CI= npm run build
- Click Save.
- Change the build command as
Then select Environment tab from the dropdown.
- Select Edit variables.
- As the Key enter
CI
and, as the value enterfalse
. - Click Save.
Finally retrying the deploying the site again.
Netlify deployment failed during stage 'building site': Build script returned non-zero exit code: 42
The error you're seeing should just be a warning and shouldn't impact deployment. I'd double-check the netlify logs again and see if there's another error you can find.
The latest published version of jekyll-sass-converter still uses the sass
gem. It looks like they haven't released a new version that uses sassc
yet.
If you add the below to your Gemfile, and then run bundle install
, Jekyll will pick up the version that uses sassc
instead of sass
and get you past the warning you see
gem 'jekyll-sass-converter', git: 'https://github.com/jekyll/jekyll-sass-converter', branch: 'master'
If that doesn't work, try and build your site locally first and see if you get any errors Build script returned non-zero exit code: 2 - React
You need to specify base directory either in netlify settings.
Go to Settings -> Build and Deploy -> Edit Settings and fill it with client
.
Or you can create netlify.toml
in project dir with following config
[build]
# Directory to change to before starting a build.
# This is where we will look for package.json/.nvmrc/etc.
# If not set, defaults to the root directory.
base = "client"
Related Topics
Reading Files in a Zip Archive, Without Unzipping The Archive
Filtering Sensitive Data with Vcr
Ruby Rspec. Get List of All Test
Parsing a CSV File Using Different Encodings and Libraries
How to Mass Rename Files in Ruby
More Ruby Way of Doing Project Euler #2
Sql Like Operator in Ruby on Rails
What's The Best Way to Test Delayed_Job Chains with Rspec
Sinatra Not Persisting Session with Redirect on Chrome
Running "Bundle Install" Fails and Asks Me to Run "Bundle Install"
How to Open File in Default Application. Ruby
How Do Erlang Actors Differ from Oop Objects
Rails3 Scope for Count of Children in Has_Many Relationship
Change Time Zone in Pure Ruby (Not Rails)
Recommended Way to Generate a Presigned Url to S3 Bucket in Ruby