Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node-sass - sass_context_wrapper.h:8:10: fatal error: sass/context.h: No such file or directory

I am trying to install node-sass but failed with the error below. I tried to rebuild command but no luck at all - sudo npm rebuild node-sass

$ npm install node-sass     

...
...
...
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir /home/lau/.node-gyp/10.12.0
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/var/www/html/projects/autopoiesis/autopoiesis/node_modules/gulp-sass/node_modules/node-sass/build'
  g++ '-DNODE_GYP_MODULE_NAME=binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/lau/.node-gyp/10.12.0/include/node -I/home/lau/.node-gyp/10.12.0/src -I/home/lau/.node-gyp/10.12.0/deps/openssl/config -I/home/lau/.node-gyp/10.12.0/deps/openssl/openssl/include -I/home/lau/.node-gyp/10.12.0/deps/uv/include -I/home/lau/.node-gyp/10.12.0/deps/zlib -I/home/lau/.node-gyp/10.12.0/deps/v8/include -I../../../../nan  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -std=c++0x -MMD -MF ./Release/.deps/Release/obj.target/binding/src/binding.o.d.raw   -c -o Release/obj.target/binding/src/binding.o ../src/binding.cpp
In file included from ../src/binding.cpp:3:0:
../src/sass_context_wrapper.h:8:10: fatal error: sass/context.h: No such file or directory
 #include <sass/context.h>
          ^~~~~~~~~~~~~~~~
compilation terminated.
binding.target.mk:116: recipe for target 'Release/obj.target/binding/src/binding.o' failed
make: *** [Release/obj.target/binding/src/binding.o] Error 1
make: Leaving directory '/var/www/html/projects/autopoiesis/autopoiesis/node_modules/gulp-sass/node_modules/node-sass/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/var/www/html/projects/autopoiesis/autopoiesis/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Linux 4.15.0-36-generic
gyp ERR! command "/usr/bin/node" "/var/www/html/projects/autopoiesis/autopoiesis/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /var/www/html/projects/autopoiesis/autopoiesis/node_modules/gulp-sass/node_modules/node-sass
gyp ERR! node -v v10.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/lau/.npm/_logs/2019-05-18T01_33_09_744Z-debug.log

Any ideas why? What can I do?

like image 706
Run Avatar asked Jan 26 '23 07:01

Run


1 Answers

Try to install it with LIBSASS_EXT="no" npm install (remove node_modules folder to trigger the node-sass build, but be aware of the removement) - basically you have to check your libsass installation. Did you install libsass on your machine? On Mac it would be brew install libsass or on Linux.

like image 84
Felix Avatar answered Jan 31 '23 06:01

Felix