Deploy failed Build script returned non-zero exit code: 1

I am trying to deploy my App on netlify and I am getting build failed error (Error running command: Build script returned non-zero exit code: 1)

Note: I successfully deployed the same app (exactly without any change) on netlify before three months and I don’t know why I am getting this error today because I am using the same code and I didn’t change anything.

3:32:57 PM: Installing NPM modules using NPM version 6.14.4
3:33:36 PM: > sharp@0.21.3 install /opt/build/repo/node_modules/sharp
3:33:36 PM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
3:33:36 PM: info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.0/libvips-8.7.0-linux-x64.tar.gz
3:33:38 PM: prebuild-install WARN install No prebuilt binaries found (target=12.18.0 runtime=node arch=x64 libc= platform=linux)
3:33:40 PM: make: Entering directory '/opt/build/repo/node_modules/sharp/build'
3:33:40 PM:   TOUCH Release/obj.target/libvips-cpp.stamp
3:33:40 PM:   CXX(target) Release/obj.target/sharp/src/common.o
3:33:41 PM: In file included from ../src/common.cc:27:0:
3:33:41 PM: ../src/common.h:78:16: error: ‘Handle’ is not a member of ‘v8’
3:33:41 PM:    bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
3:33:41 PM:                 ^
3:33:41 PM: ../src/common.h:78:37: error: expected primary-expression before ‘>’ token
3:33:41 PM:    bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
3:33:41 PM:                                      ^
3:33:41 PM: ../src/common.h:78:39: error: ‘obj’ was not declared in this scope
3:33:41 PM:    bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
3:33:41 PM:                                        ^
3:33:41 PM: ../src/common.h:78:56: error: expected primary-expression before ‘attr’
3:33:41 PM:    bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
3:33:41 PM:                                                         ^
3:33:41 PM: ../src/common.h:78:60: error: expression list treated as compound expression in initializer [-fpermissive]
3:33:41 PM:    bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
3:33:41 PM:                                                             ^
3:33:41 PM: ../src/common.h:79:25: error: ‘Handle’ is not a member of ‘v8’
3:33:41 PM:    std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
3:33:41 PM:                          ^
3:33:41 PM: ../src/common.h:79:46: error: expected primary-expression before ‘>’ token
3:33:41 PM:    std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
3:33:41 PM:                                               ^
3:33:41 PM: ../src/common.h:79:48: error: ‘obj’ was not declared in this scope
3:33:41 PM:    std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
3:33:41 PM:                                                 ^
3:33:41 PM: ../src/common.h:79:65: error: expected primary-expression before ‘attr’
3:33:41 PM:    std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
3:33:41 PM:                                                                  ^
3:33:41 PM: ../src/common.h:80:34: error: ‘Handle’ is not a member of ‘v8’
3:33:41 PM:    std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
3:33:41 PM:                                   ^
3:33:41 PM: ../src/common.h:80:55: error: expected primary-expression before ‘>’ token
3:33:41 PM:    std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
3:33:41 PM:                                                        ^
3:33:41 PM: ../src/common.h:80:57: error: ‘obj’ was not declared in this scope
3:33:41 PM:    std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
3:33:41 PM:                                                          ^
3:33:41 PM: ../src/common.h:80:74: error: expected primary-expression before ‘attr’
3:33:41 PM:    std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
3:33:41 PM:                                                                           ^
3:33:41 PM: ../src/common.h:81:44: error: ‘Handle’ is not a member of ‘v8’
3:33:41 PM:    template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                             ^
3:33:41 PM: ../src/common.h:81:65: error: expected primary-expression before ‘>’ token
3:33:41 PM:    template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                                                  ^
3:33:41 PM: ../src/common.h:81:67: error: ‘obj’ was not declared in this scope
3:33:41 PM:    template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                                                    ^
3:33:41 PM: ../src/common.h:81:84: error: expected primary-expression before ‘attr’
3:33:41 PM:    template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                                                                     ^
3:33:41 PM: ../src/common.h:81:37: warning: variable templates only available with -std=c++14 or -std=gnu++14
3:33:41 PM:    template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                      ^
3:33:41 PM: ../src/common.h:81:90: error: expected ‘;’ before ‘{’ token
3:33:41 PM:    template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                                                                           ^
3:33:41 PM: ../src/common.h:84:33: error: ‘Handle’ is not a member of ‘v8’
3:33:41 PM:    template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                  ^
3:33:41 PM: ../src/common.h:84:54: error: expected primary-expression before ‘>’ token
3:33:41 PM:    template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                                       ^
3:33:41 PM: ../src/common.h:84:56: error: ‘obj’ was not declared in this scope
3:33:41 PM:    template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                                         ^
3:33:41 PM: ../src/common.h:84:73: error: expected primary-expression before ‘attr’
3:33:41 PM:    template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                                                          ^
3:33:41 PM: ../src/common.h:84:26: warning: variable templates only available with -std=c++14 or -std=gnu++14
3:33:41 PM:    template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                           ^
3:33:41 PM: ../src/common.h:84:79: error: expected ‘;’ before ‘{’ token
3:33:41 PM:    template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                                                                ^
3:33:41 PM: ../src/common.h:87:33: error: ‘Handle’ is not a member of ‘v8’
3:33:41 PM:    template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
3:33:41 PM:                                  ^
3:33:41 PM: ../src/common.h:87:54: error: expected primary-expression before ‘>’ token
3:33:41 PM:    template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
3:33:41 PM:                                                       ^
3:33:41 PM: ../src/common.h:87:56: error: ‘obj’ was not declared in this scope
3:33:41 PM:    template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
3:33:41 PM:                                                         ^
3:33:41 PM: ../src/common.h:87:61: error: expected primary-expression before ‘int’
3:33:41 PM:    template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
3:33:41 PM:                                                              ^
3:33:41 PM: ../src/common.h:84:26: warning: variable templates only available with -std=c++14 or -std=gnu++14
3:33:41 PM:    template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                           ^
3:33:41 PM: ../src/common.h:87:71: error: expected ‘;’ before ‘{’ token
3:33:41 PM:    template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
3:33:41 PM:                                                                        ^
3:33:41 PM: ../src/common.h:93:5: error: ‘Handle’ is not a member of ‘v8’
3:33:41 PM:      v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
3:33:41 PM:      ^
3:33:41 PM: ../src/common.h:93:26: error: expected primary-expression before ‘>’ token
3:33:41 PM:      v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
3:33:41 PM:                           ^
3:33:41 PM: ../src/common.h:93:28: error: ‘input’ was not declared in this scope
3:33:41 PM:      v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
3:33:41 PM:                             ^
3:33:41 PM: ../src/common.h:93:70: error: expected primary-expression before ‘&’ token
3:33:41 PM:      v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
3:33:41 PM:                                                                       ^
3:33:41 PM: ../src/common.h:93:71: error: ‘buffersToPersist’ was not declared in this scope
3:33:41 PM:      v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
3:33:41 PM:                                                                        ^
3:33:41 PM: ../src/common.h:93:87: error: expression list treated as compound expression in initializer [-fpermissive]
3:33:41 PM:      v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
3:33:41 PM:                                                                                        ^
3:33:41 PM: ../src/common.cc:34:20: error: redefinition of ‘bool sharp::HasAttr’
3:33:41 PM:    bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                     ^
3:33:41 PM: In file included from ../src/common.cc:27:0:
3:33:41 PM: ../src/common.h:78:8: note: ‘bool sharp::HasAttr’ previously defined here
3:33:41 PM:    bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
3:33:41 PM:         ^
3:33:41 PM: ../src/common.cc:34:16: error: ‘Handle’ is not a member of ‘v8’
3:33:41 PM:    bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                 ^
3:33:41 PM: ../src/common.cc:34:37: error: expected primary-expression before ‘>’ token
3:33:41 PM:    bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                      ^
3:33:41 PM: ../src/common.cc:34:39: error: ‘obj’ was not declared in this scope
3:33:41 PM:    bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                        ^
3:33:41 PM: ../src/common.cc:34:56: error: expected primary-expression before ‘attr’
3:33:41 PM:    bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                                         ^
3:33:41 PM: ../src/common.cc:37:29: error: redefinition of ‘std::string sharp::AttrAsStr’
3:33:41 PM:    std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                              ^
3:33:41 PM: In file included from ../src/common.cc:27:0:
3:33:41 PM: ../src/common.h:79:15: note: ‘std::string sharp::AttrAsStr’ previously declared here
3:33:41 PM:    std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
3:33:41 PM:                ^
3:33:41 PM: ../src/common.cc:37:25: error: ‘Handle’ is not a member of ‘v8’
3:33:41 PM:    std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                          ^
3:33:41 PM: ../src/common.cc:37:46: error: expected primary-expression before ‘>’ token
3:33:41 PM:    std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                               ^
3:33:41 PM: ../src/common.cc:37:48: error: ‘obj’ was not declared in this scope
3:33:41 PM:    std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                                 ^
3:33:41 PM: ../src/common.cc:37:65: error: expected primary-expression before ‘attr’
3:33:41 PM:    std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                                                  ^
3:33:41 PM: ../src/common.cc:40:38: error: redefinition of ‘std::vector<double> sharp::AttrAsRgba’
3:33:41 PM:    std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                       ^
3:33:41 PM: In file included from ../src/common.cc:27:0:
3:33:41 PM: ../src/common.h:80:23: note: ‘std::vector<double> sharp::AttrAsRgba’ previously declared here
3:33:41 PM:    std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
3:33:41 PM:                        ^
3:33:41 PM: ../src/common.cc:40:34: error: ‘Handle’ is not a member of ‘v8’
3:33:41 PM:    std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                   ^
3:33:41 PM: ../src/common.cc:40:55: error: expected primary-expression before ‘>’ token
3:33:41 PM:    std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                                        ^
3:33:41 PM: ../src/common.cc:40:57: error: ‘obj’ was not declared in this scope
3:33:41 PM:    std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                                          ^
3:33:41 PM: ../src/common.cc:40:74: error: expected primary-expression before ‘attr’
3:33:41 PM:    std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr) {
3:33:41 PM:                                                                           ^
3:33:41 PM: ../src/common.cc:654:1: error: expected ‘}’ at end of input
3:33:41 PM:  }  // namespace sharp
3:33:41 PM:  ^
3:33:41 PM: cc1plus: warning: unrecognized command line option ‘-Wno-cast-function-type’
3:33:41 PM: sharp.target.mk:138: recipe for target 'Release/obj.target/sharp/src/common.o' failed
3:33:41 PM: make: *** [Release/obj.target/sharp/src/common.o] Error 1
3:33:41 PM: make: Leaving directory '/opt/build/repo/node_modules/sharp/build'
3:33:41 PM: gyp ERR! build error
3:33:41 PM: gyp ERR! stack Error: `make` failed with exit code: 2
3:33:41 PM: gyp ERR! stack     at ChildProcess.onExit (/opt/buildhome/.nvm/versions/node/v12.18.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
3:33:41 PM: gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
3:33:41 PM: gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
3:33:41 PM: gyp ERR! System Linux 4.14.138+
3:33:41 PM: gyp ERR! command "/opt/buildhome/.nvm/versions/node/v12.18.0/bin/node" "/opt/buildhome/.nvm/versions/node/v12.18.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
3:33:41 PM: gyp ERR! cwd /opt/build/repo/node_modules/sharp
3:33:41 PM: gyp ERR! node -v v12.18.0
3:33:41 PM: gyp ERR! node-gyp -v v5.1.0
3:33:41 PM: gyp ERR! not ok
3:33:44 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents):
3:33:44 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
3:33:44 PM: npm ERR! code ELIFECYCLE
3:33:44 PM: npm ERR! errno 1
3:33:44 PM: npm ERR! sharp@0.21.3 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
3:33:44 PM: npm ERR! Exit status 1
3:33:44 PM: npm ERR!
3:33:44 PM: npm ERR! Failed at the sharp@0.21.3 install script.
3:33:44 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
3:33:44 PM: npm ERR! A complete log of this run can be found in:
3:33:44 PM: npm ERR!     /opt/buildhome/.npm/_logs/2020-08-03T12_33_44_321Z-debug.log
3:33:44 PM: Error during NPM install
3:33:44 PM: Error running command: Build script returned non-zero exit code: 1
3:33:44 PM: Failing build: Failed to build site
3:33:44 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1
3:33:44 PM: Finished processing build request in 53.96840015s
`

Looks like you might have a curly boy problem there. Are you sure you didnt change the code in any way?

If you miss one } you might end up with all the other build problems above that line.

1 Like

Thanks @mrboen94

Yes I am 100% sure I didn’t change anything

I don’t know why I can’t deploy my app now. I deployed the same app many times previously without any problem.

This is the link of the source code and I am using the same code without any change

well, it is possible we made a change on our end to make our validating a bit more strict, so that what used to work (but was wrong) no longer does.

Are you able to build & deploy successfully after fixing the curly? That’s my main goal here - getting you up and running again.

Thanks @perry I really appreciate your assistance

Actually, I don’t know where I can find the curly in which file. I am not professional in JavaScript. I am just using app template and I was able to deploy this template successfully before a few weeks.

Today, I tried to deploy the same app template again and I got a new error. I don’t know what’s going on and I don’t know how to fix this issue.

11:17:39 AM: Build ready to start
11:17:41 AM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
11:17:41 AM: build-image tag: v3.4.1
11:17:41 AM: buildbot version: 4c73738fafb40608518be6837f4675455e8cfe64
11:17:41 AM: Fetching cached dependencies
11:17:41 AM: Failed to fetch cache, continuing with build
11:17:41 AM: Starting to prepare the repo for build
11:17:42 AM: No cached dependencies found. Cloning fresh repo
11:17:42 AM: git clone https://github.com/CyanBrain/testy
11:17:43 AM: Preparing Git Reference refs/heads/master
11:17:44 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'public' versus 'public/' in the Netlify UI
11:17:44 AM: Starting build script
11:17:44 AM: Installing dependencies
11:17:44 AM: Python version set to 2.7
11:17:45 AM: v12.18.0 is already installed.
11:17:46 AM: Now using node v12.18.0 (npm v6.14.4)
11:17:46 AM: Started restoring cached build plugins
11:17:46 AM: Finished restoring cached build plugins
11:17:46 AM: Attempting ruby version 2.7.1, read from environment
11:17:47 AM: Using ruby version 2.7.1
11:17:48 AM: Using PHP version 5.6
11:17:48 AM: 5.2 is already installed.
11:17:48 AM: Using Swift version 5.2
11:17:48 AM: Started restoring cached node modules
11:17:48 AM: Finished restoring cached node modules
11:17:48 AM: Installing NPM modules using NPM version 6.14.4
11:18:25 AM: npm ERR! code E404
11:18:25 AM: npm ERR! 404 Not Found - GET https://registry.npmjs.org/@jupyterlab/outputarea/-/outputarea-0.19.1.tgz
11:18:25 AM: npm ERR! 404
11:18:25 AM: npm ERR! 404  '@jupyterlab/outputarea@0.19.1' is not in the npm registry.
11:18:25 AM: npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
11:18:25 AM: npm ERR! 404 It was specified as a dependency of 'repo'
11:18:25 AM: npm ERR! 404
11:18:25 AM: npm ERR! 404 Note that you can also install from a
11:18:25 AM: npm ERR! 404 tarball, folder, http url, or git url.
11:19:12 AM: npm ERR! A complete log of this run can be found in:
11:19:12 AM: npm ERR!     /opt/buildhome/.npm/_logs/2020-08-06T08_18_25_955Z-debug.log
11:19:12 AM: Error during NPM install
11:19:12 AM: Error running command: Build script returned non-zero exit code: 1
11:19:12 AM: Failing build: Failed to build site
11:19:12 AM: Failed during stage 'building site': Build script returned non-zero exit code: 1
11:19:12 AM: Finished processing build request in 1m31.234849296s

I fixed this problem using NODE_VERSION = 10.22.0

Thanks.

1 Like