Home
Support Forums

Build failing on netlify

Hi there,

And sorry for posting in here about another deployment failure but I’ve tried fixing this so many different ways and I keep running in to the same problem. I have a site on which I’m trying to deploy on Netlify but the build keeps failing. The build works fine locally but on netlify it says build failed. I narrowed down that it’s most likely something to do with node-sass so I deleted it and added “sass” & “sass-loader” as per answers on stack overflow but no luck!

Could someone point me in the direction I’m going wrong! And sorry again!!

1:54:14 PM: Finished restoring cached node modules

1:54:15 PM: Installing NPM modules using NPM version 8.0.0

1:54:17 PM: npm WARN old lockfile

1:54:17 PM: npm WARN old lockfile The package-lock.json file was created with an old version of npm,

1:54:17 PM: npm WARN old lockfile so supplemental metadata must be fetched from the registry.

1:54:17 PM: npm WARN old lockfile

1:54:17 PM: npm WARN old lockfile This is a one-time fix-up, please be patient…

1:54:17 PM: npm WARN old lockfile

1:54:34 PM: npm WARN deprecated urix@0.1.0: Please see GitHub - lydell/urix: [DEPRECATED] Makes Windows-style paths more unix and URI friendly.

1:54:34 PM: npm WARN deprecated har-validator@5.1.5: this library is no longer supported

1:54:34 PM: npm WARN deprecated resolve-url@0.2.1: GitHub - lydell/resolve-url: [DEPRECATED] Like Node.js’ `path.resolve`/`url.resolve` for the browser.

1:54:36 PM: npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See There’s Math.random(), and then there’s Math.random() · V8 for details.

1:54:37 PM: npm WARN deprecated request@2.88.2: request has been deprecated, see Request’s Past, Present and Future · Issue #3142 · request/request · GitHub

1:54:42 PM: npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (ReDos Vulnerability Regression Visibility Notice · Issue #797 · visionmedia/debug · GitHub)

1:54:42 PM: npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.

1:54:42 PM: npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.

1:54:42 PM: npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (ReDos Vulnerability Regression Visibility Notice · Issue #797 · visionmedia/debug · GitHub)

1:54:43 PM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.

1:54:44 PM: npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.

1:57:02 PM: npm ERR! code 1

1:57:02 PM: npm ERR! path /opt/build/repo/node_modules/node-sass

1:57:02 PM: npm ERR! command failed

1:57:02 PM: npm ERR! command sh -c node scripts/build.js

1:57:02 PM: npm ERR! Building: /opt/buildhome/.nvm/versions/node/v16.11.1/bin/node /opt/build/repo/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=

1:57:02 PM: npm ERR! make: Entering directory ‘/opt/build/repo/node_modules/node-sass/build’

1:57:02 PM: npm ERR! g++ ‘-DNODE_GYP_MODULE_NAME=libsass’ ‘-DUSING_UV_SHARED=1’ ‘-DUSING_V8_SHARED=1’ ‘-DV8_DEPRECATION_WARNINGS=1’ ‘-DV8_DEPRECATION_WARNINGS’ ‘-DV8_IMMINENT_DEPRECATION_WARNINGS’ ‘-D_GLIBCXX_USE_CXX11_ABI=1’ ‘-D_LARGEFILE_SOURCE’ ‘-D_FILE_OFFSET_BITS=64’ ‘-D__STDC_FORMAT_MACROS’ ‘-DOPENSSL_NO_PINSHARED’ ‘-DOPENSSL_THREADS’ ‘-DLIBSASS_VERSION=“3.5.5”’ -I/opt/buildhome/.node-gyp/16.11.1/include/node -I/opt/buildhome/.node-gyp/16.11.1/src -I/opt/buildhome/.node-gyp/16.11.1/deps/openssl/config -I/opt/buildhome/.node-gyp/16.11.1/deps/openssl/openssl/include -I/opt/buildhome/.node-gyp/16.11.1/deps/uv/include -I/opt/buildhome/.node-gyp/16.11.1/deps/zlib -I/opt/buildhome/.node-gyp/16.11.1/deps/v8/include -I…/src/libsass/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast.o.d.raw -c -o Release/obj.target/libsass/src/libsass/src/ast.o …/src/libsass/src/ast.cpp

1:57:02 PM: npm ERR! g++ ‘-DNODE_GYP_MODULE_NAME=libsass’ ‘-DUSING_UV_SHARED=1’ ‘-DUSING_V8_SHARED=1’ ‘-DV8_DEPRECATION_WARNINGS=1’ ‘-DV8_DEPRECATION_WARNINGS’ ‘-DV8_IMMINENT_DEPRECATION_WARNINGS’ ‘-D_GLIBCXX_USE_CXX11_ABI=1’ ‘-D_LARGEFILE_SOURCE’ ‘-D_FILE_OFFSET_BITS=64’ ‘-D__STDC_FORMAT_MACROS’ ‘-DOPENSSL_NO_PINSHARED’ ‘-DOPENSSL_THREADS’ ‘-DLIBSASS_VERSION=“3.5.5”’ -I/opt/buildhome/.node-gyp/16.11.1/include/node -I/opt/buildhome/.node-gyp/16.11.1/src -I/opt/buildhome/.node-gyp/16.11.1/deps/openssl/config -I/opt/buildhome/.node-gyp/16.11.1/deps/openssl/openssl/include -I/opt/buildhome/.node-gyp/16.11.1/deps/uv/include -I/opt/buildhome/.node-gyp/16.11.1/deps/zlib -I/opt/buildhome/.node-gyp/16.11.1/deps/v8/include -I…/src/libsass/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast_fwd_decl.o.d.raw -c -o Release/obj.target/libsass/src/libsass/src/ast_fwd_decl.o …/src/libsass/src/ast_fwd_decl.cpp

1:57:02 PM: npm ERR! g++ ‘-DNODE_GYP_MODULE_NAME=libsass’ ‘-DUSING_UV_SHARED=1’ ‘-DUSING_V8_SHARED=1’ ‘-DV8_DEPRECATION_WARNINGS=1’ ‘-DV8_DEPRECATION_WARNINGS’ ‘-DV8_IMMINENT_DEPRECATION_WARNINGS’ ‘-D_GLIBCXX_USE_CXX11_ABI=1’ ‘-D_LARGEFILE_SOURCE’ ‘-D_FILE_OFFSET_BITS=64’ ‘-D__STDC_FORMAT_MACROS’ ‘-DOPENSSL_NO_PINSHARED’ ‘-DOPENSSL_THREADS’ ‘-DLIBSASS_VERSION=“3.5.5”’ -I/opt/buildhome/.node-gyp/16.11.1/include/node -I/opt/buildhome/.node-gyp/16.11.1/src -I/opt/buildhome/.node-gyp/16.11.1/deps/openssl/config -I/opt/buildhome/.node-gyp/16.11.1/deps/openssl/openssl/include -I/opt/buildhome/.node-gyp/16.11.1/deps/uv/include -I/opt/buildhome/.node-gyp/16.11.1/deps/zlib -I/opt/buildhome/.node-gyp/16.11.1/deps/v8/include -I…/src/libsass/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/backtrace.o.d.raw -c -o Release/obj.target/libsass/src/libsass/src/backtrace.o …/src/libsass/src/backtrace.cpp

HI @frazerf

If it is due to node-sass, it is a version error. Solution is to upgrade node-sass or downgrade node.js. (See answer here.)

The latest build image uses node.js v16. If you are not running v16 locally, this is a potential cause of conflicts. Old packages may not work on newer node versions. As per answer linked above, you can upgrade your packages, or downgrade the node version used to build your site to match your local version.