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

标签 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以及最新版本的node-sass等上遇到了相同的问题。

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

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


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

最佳答案

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

关于node.js - 由于Utf8Value需要2个值,因此无法使用npm install安装主题-node-gyp错误? Node 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56927882/

相关文章:

node.js - 带有base64摘要算法的nodejs md5错误结果

javascript - 如何在 AWS DynamoDB 中按排序键查询?

node.js - 在 Vagrant 中启动 npm 后的 Web 应用程序 URL

node.js - 尝试运行 Strapi 会导致模块解析错误

node.js - Windows 7 上的 npm install Restify 错误?

javascript - Webpack 找不到动态(js)添加的背景图片

javascript - 如何在 Mongoose 中构建各种相互依赖的模式或如何正确使用 'reference'?

javascript - 在 NodeJS 子进程中执行任意 JavaScript 代码(不是命令)

node.js - 使用quotaUser后,userRateLimitExceeded错误谷歌驱动器API

node.js - 没有 sudo 无法使用 NPM