Docker build fails when building node-sass #100

Closed
opened 2026-02-04 17:11:56 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @Oni on GitHub (May 14, 2021).

How to reproduce: download/clone the repo and then run docker build ..

I get the error if I try to run the above command on a windows machine and on a raspberry pi.

Docker returns a wall of text. I try to paste the relevant parts:

#14 231.4 npm ERR! code 1
#14 231.4 npm ERR! path /app/node_modules/node-sass
#14 231.4 npm ERR! command failed
#14 231.4 npm ERR! command sh -c node scripts/build.js
#14 231.4 npm ERR! Building: /usr/local/bin/node /app/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
#14 231.4 npm ERR! make: Entering directory '/app/node_modules/node-sass/build'
#14 231.4 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/root/.node-gyp/16.1.0/include/node -I/root/.node-gyp/16.1.0/src -I/root/.node-gyp/16.1.0/deps/openssl/config -I/root/.node-gyp/16.1.0/deps/openssl/openssl/include -I/root/.node-gyp/16.1.0/deps/uv/include -I/root/.node-gyp/16.1.0/deps/zlib -I/root/.node-gyp/16.1.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++1y -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
<wall of text here>
#14 231.5 npm ERR! In file included from ../../nan/nan.h:56,
#14 231.5 npm ERR!                  from ../src/binding.cpp:1:
#14 231.5 npm ERR! ../src/binding.cpp: At global scope:
#14 231.5 npm ERR! /root/.node-gyp/16.1.0/include/node/node.h:806:43: warning: cast between incompatible function types from 'void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)' {aka 'void (*)(v8::Local<v8::Object>)'} to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
#14 231.5 npm ERR!        (node::addon_register_func) (regfunc),                          \
#14 231.5 npm ERR!                                            ^
#14 231.5 npm ERR! /root/.node-gyp/16.1.0/include/node/node.h:840:3: note: in expansion of macro 'NODE_MODULE_X'
#14 231.5 npm ERR!    NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
#14 231.5 npm ERR!    ^~~~~~~~~~~~~
#14 231.5 npm ERR! ../src/binding.cpp:358:1: note: in expansion of macro 'NODE_MODULE'
#14 231.5 npm ERR!  NODE_MODULE(binding, RegisterModule);
#14 231.5 npm ERR!  ^~~~~~~~~~~
#14 231.5 npm ERR! make: *** [binding.target.mk:133: Release/obj.target/binding/src/binding.o] Error 1
#14 231.5 npm ERR! gyp ERR! build error
#14 231.5 npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
#14 231.5 npm ERR! gyp ERR! stack     at ChildProcess.onExit (/app/node_modules/node-gyp/lib/build.js:262:23)
#14 231.5 npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
#14 231.5 npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
#14 231.5 npm ERR! gyp ERR! System Linux 5.4.72-microsoft-standard-WSL2
#14 231.5 npm ERR! gyp ERR! command "/usr/local/bin/node" "/app/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
#14 231.5 npm ERR! gyp ERR! cwd /app/node_modules/node-sass
#14 231.5 npm ERR! gyp ERR! node -v v16.1.0
#14 231.5 npm ERR! gyp ERR! node-gyp -v v3.8.0
#14 231.5 npm ERR! gyp ERR! not ok
#14 231.5 npm ERR! Build failed with error code: 1
#14 232.0
#14 232.0 npm ERR! A complete log of this run can be found in:
#14 232.0 npm ERR!     /root/.npm/_logs/2021-05-14T17_09_36_986Z-debug.log

Is it possible that there is a compatibility issue (see node version support policy) between node-sass and node versions?

Originally created by @Oni on GitHub (May 14, 2021). How to reproduce: download/clone the repo and then run `docker build .`. I get the error if I try to run the above command on a windows machine and on a raspberry pi. Docker returns a wall of text. I try to paste the relevant parts: ``` #14 231.4 npm ERR! code 1 #14 231.4 npm ERR! path /app/node_modules/node-sass #14 231.4 npm ERR! command failed #14 231.4 npm ERR! command sh -c node scripts/build.js #14 231.4 npm ERR! Building: /usr/local/bin/node /app/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library= #14 231.4 npm ERR! make: Entering directory '/app/node_modules/node-sass/build' #14 231.4 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/root/.node-gyp/16.1.0/include/node -I/root/.node-gyp/16.1.0/src -I/root/.node-gyp/16.1.0/deps/openssl/config -I/root/.node-gyp/16.1.0/deps/openssl/openssl/include -I/root/.node-gyp/16.1.0/deps/uv/include -I/root/.node-gyp/16.1.0/deps/zlib -I/root/.node-gyp/16.1.0/deps/v8/include -I../src/libsass/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++1y -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 <wall of text here> #14 231.5 npm ERR! In file included from ../../nan/nan.h:56, #14 231.5 npm ERR! from ../src/binding.cpp:1: #14 231.5 npm ERR! ../src/binding.cpp: At global scope: #14 231.5 npm ERR! /root/.node-gyp/16.1.0/include/node/node.h:806:43: warning: cast between incompatible function types from 'void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)' {aka 'void (*)(v8::Local<v8::Object>)'} to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type] #14 231.5 npm ERR! (node::addon_register_func) (regfunc), \ #14 231.5 npm ERR! ^ #14 231.5 npm ERR! /root/.node-gyp/16.1.0/include/node/node.h:840:3: note: in expansion of macro 'NODE_MODULE_X' #14 231.5 npm ERR! NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage) #14 231.5 npm ERR! ^~~~~~~~~~~~~ #14 231.5 npm ERR! ../src/binding.cpp:358:1: note: in expansion of macro 'NODE_MODULE' #14 231.5 npm ERR! NODE_MODULE(binding, RegisterModule); #14 231.5 npm ERR! ^~~~~~~~~~~ #14 231.5 npm ERR! make: *** [binding.target.mk:133: Release/obj.target/binding/src/binding.o] Error 1 #14 231.5 npm ERR! gyp ERR! build error #14 231.5 npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2 #14 231.5 npm ERR! gyp ERR! stack at ChildProcess.onExit (/app/node_modules/node-gyp/lib/build.js:262:23) #14 231.5 npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:365:28) #14 231.5 npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12) #14 231.5 npm ERR! gyp ERR! System Linux 5.4.72-microsoft-standard-WSL2 #14 231.5 npm ERR! gyp ERR! command "/usr/local/bin/node" "/app/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" #14 231.5 npm ERR! gyp ERR! cwd /app/node_modules/node-sass #14 231.5 npm ERR! gyp ERR! node -v v16.1.0 #14 231.5 npm ERR! gyp ERR! node-gyp -v v3.8.0 #14 231.5 npm ERR! gyp ERR! not ok #14 231.5 npm ERR! Build failed with error code: 1 #14 232.0 #14 232.0 npm ERR! A complete log of this run can be found in: #14 232.0 npm ERR! /root/.npm/_logs/2021-05-14T17_09_36_986Z-debug.log ``` Is it possible that there is a compatibility issue [(see node version support policy)](https://github.com/sass/node-sass#node-version-support-policy) between node-sass and node versions?
Author
Owner

@meltyshev commented on GitHub (May 12, 2025):

This should have been fixed a while ago, but feel free to reopen if the issue persists.

@meltyshev commented on GitHub (May 12, 2025): This should have been fixed a while ago, but feel free to reopen if the issue persists.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#100