由于Utf8Value需要2个值-node-gyp错误,因此无法使用npm install安装主题。节点错误?

时间:2019-07-08 02:53:55

标签: node.js npm

我尝试按照blk-design-system-react documentation中的说明将src/assets目录添加到应用程序assets的子目录src中,然后将以下内容添加到我的App.js顶部:

import "assets/scss/blk-design-system-react.scss";
import "assets/css/nucleo-icons.css";

然后

<!--     Fonts and icons     -->
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700,200" rel="stylesheet" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css" />

在我的index.html标记中,但是对于使用create-react-app创建的基本应用而言,主题没有改变。

然后,我用nvm v12.4.0, npm 6.9.0, node-sass@4.12.0, node-gyp@3.8.0, GPP 2.24, GNU Make 3.81尝试使用npm i blk-design-system-react并遇到以下错误:

../src/create_string.cpp: In function ‘char* create_string(Nan::MaybeLocal<v8::Value>)’:
../src/create_string.cpp:17:37: error: no matching function for call to ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>&)’
   v8::String::Utf8Value string(value);
                                     ^
../src/create_string.cpp:17:37: note: candidate is:
In file included from /home/wbkboyer/.node-gyp/12.4.0/include/node/node.h:63:0,
                 from ../../../../nan/nan.h:54,
                 from ../src/create_string.cpp:1:
/home/wbkboyer/.node-gyp/12.4.0/include/node/v8.h:2995:5: note: v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)
     Utf8Value(Isolate* isolate, Local<v8::Value> obj);
     ^
/home/wbkboyer/.node-gyp/12.4.0/include/node/v8.h:2995:5: note:   candidate expects 2 arguments, 1 provided
make: *** [Release/obj.target/binding/src/create_string.o] Error 1
make: Leaving directory `/home/wbkboyer/git/locomath/locomath-app/node_modules/blk-design-system-react/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 (/home/wbkboyer/git/locomath/locomath-app/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:200:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 3.19.0-32-generic
gyp ERR! command "/home/wbkboyer/.nvm/versions/node/v12.4.0/bin/node" "/home/wbkboyer/git/locomath/locomath-app/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/wbkboyer/git/locomath/locomath-app/node_modules/blk-design-system-react/node_modules/node-sass
gyp ERR! node -v v12.4.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1

主要错误似乎是基于node-gyp的地方

../src/create_string.cpp:17:37: error: no matching function for call to ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>&)’
   v8::String::Utf8Value string(value);
...
/home/wbkboyer/.node-gyp/12.4.0/include/node/v8.h:2995:5: note:   candidate expects 2 arguments, 1 provided

我在nvm 12.5.0npm 6.9.0的最新版本等方面遇到了相同的问题。

TL; DR如何在新的React项目中安装和使用node-sass或与此相关的任何主题?感谢您的时间和帮助!

编辑:我认为我会包括一些链接,这些链接显示出与我观察到的相同的错误:

  1. Node-gyp bug #1763:“节点12.3.1上的构建失败”
  2. Node-sass bug #2632“对node.js 12.x的支持”

1 个答案:

答案 0 :(得分:0)

好吧,回答我问题的第一部分,这些步骤实际上确实改变了字体和样式。我必须构建一个组件以查看实际情况。我仍然看不到npm install作为主题的目的是……感谢您的阅读!