gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 02:48:05 24 4
gpt4 key购买 nike

我尝试按照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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com