当前位置:   article > 正文

 node-sass 安装失败 “v8::String::Utf8Value_../src/create_string.cpp:17:25: error: no matching

../src/create_string.cpp:17:25: error: no matching constructor for initializ

 node-sass 安装失败“v8::String::Utf8Value”

基本报错

  1. ../src/create_string.cpp:17:25: error: no matching constructor for initialization of 'v8::String::Utf8Value'
  2. v8::String::Utf8Value string(value);
  3. ^ ~~~~~
  4. /Users/hongsen.ren/.node-gyp/12.1.0/include/node/v8.h:3002:5: note: candidate constructor not viable: no known
  5. conversion from 'v8::Local<v8::Value>' to 'const v8::String::Utf8Value' for 1st argument
  6. Utf8Value(const Utf8Value&) = delete;
  7. ^
  8. /Users/hongsen.ren/.node-gyp/12.1.0/include/node/v8.h:2995:5: note: candidate constructor not viable: requires
  9. 2 arguments, but 1 was provided
  10. Utf8Value(Isolate* isolate, Local<v8::Value> obj);
  11. ^
  12. 1 error generated.
  13. make: *** [Release/obj.target/binding/src/create_string.o] Error 1
  14. gyp ERR! build error
  15. gyp ERR! stack Error: `make` failed with exit code: 2
  16. gyp ERR! stack at ChildProcess.onExit (/Users/hongsen.ren/code/bk_cmdb/bk-cmdb/src/ui/node_modules/node-gyp/lib/build.js:262:23)
  17. gyp ERR! stack at ChildProcess.emit (events.js:196:13)
  18. gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
  19. gyp ERR! System Darwin 18.6.0
  20. gyp ERR! command "/usr/local/Cellar/node/12.1.0/bin/node" "/Users/hongsen.ren/code/bk_cmdb/bk-cmdb/src/ui/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
  21. gyp ERR! cwd /Users/hongsen.ren/code/bk_cmdb/bk-cmdb/src/ui/node_modules/node-sass
  22. gyp ERR! node -v v12.1.0
  23. gyp ERR! node-gyp -v v3.8.0
  24. gyp ERR! not ok
  25. Build failed with error code: 1

其实很简单,根据node和npm的版本指定要安装的node-sass版本

  1. System Darwin 18.6.0
  2. node -v v12.1.0
  3. node-gyp -v v3.8.0
  4. npm -v 6.9.0

最终安装成功

cnpm install node-sass@4.12.0
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/138991
推荐阅读
相关标签
  

闽ICP备14008679号