node-sass_context_wrapper.h:8:10:致命错误:sass/context.h:没有这样的文件



我正在尝试安装节点sass,但失败了下面的错误。我试图重建命令,但根本没有运气-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 website@0.1.0 No description
npm WARN website@0.1.0 No repository field.
npm WARN website@0.1.0 No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@3.13.1 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

有什么想法?我该怎么办?

尝试使用LIBSASS_EXT="no" npm install安装它(删除node_modules文件夹以触发node-sass构建,但要注意删除( - 基本上,您必须检查libsass安装。您是否在计算机上安装了libsass?在Mac上是brew install libsass或Linux。

最近的ubuntu版本具有默认存储库中可用的 libsass-dev(在ubuntu 20.04上测试(

只是跟随救援:

sudo apt-get install libsass-dev

libsass_ext =; no&quot;npm i

最新更新