【问题标题】:NPM - node sass error when trying to install dependency [duplicate]NPM - 尝试安装依赖项时出现节点 sass 错误 [重复]
【发布时间】:2020-01-21 12:55:22
【问题描述】:

在使用节点 13.1.0 安装我的依赖项时收到一堆警告和错误。

C ++ -DNODE_GYP_MODULE_NAME =结合' '-DUSING_UV_SHARED = 1' '-DUSING_V8_SHARED = 1' '-DV8_DEPRECATION_WARNINGS = 1' '-DV8_DEPRECATION_WARNINGS''-DV8_IMMINENT_DEPRECATION_WARNINGS '-D_DARWIN_USE_64_BIT_INODE = 1''-D_LARGEFILE_SOURCE“-D_FILE_OFFSET_BITS = 64''-DOPENSSL_NO_PINSHARED''-DOPENSSL_THREADS''-DBUILDING_NODE_EXTENSION'-I/Users/marinosony/.node-gyp/13.1.0/include/node-I/Users/marinosony/.node-gyp/13.1.0/src -I/Users/marinosony/.node-gyp/13.1.0/deps/openssl/config -I/Users/marinosony/.node-gyp/13.1.0/deps/openssl/openssl/include -I/Users/marinosony /.node-gyp/13.1.0/deps/uv/include -I/Users/marinosony/.node-gyp/13.1.0/deps/zlib -I/Users/marinosony/.node-gyp/13.1.0/ deps/v8/include -I../../nan -I../src/libsass/include -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W - Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-rtti -fno-exceptions -std=c++11 -MMD -MF ./Release/.deps/Release/obj.target/binding/ src/create_string.o.d.raw -c -o 发布/obj.tar获取/绑定/src/create_string.o ../src/create_string.cpp ../src/create_string.cpp:17:25: 错误:没有匹配的构造函数用于初始化'v8::String::Utf8Value' v8::String::Utf8Value 字符串(值); ^ ~~~~~ /Users/marinosony/.node-gyp/13.1.0/include/node/v8.h:3064:5:注意:候选构造函数不可行:没有已知的转换 第一个参数的“v8::Local”到“const v8::String::Utf8Value” Utf8Value(const Utf8Value&) = 删除; ^ /Users/marinosony/.node-gyp/13.1.0/include/node/v8.h:3057:5:注意:候选构造函数不可行:需要2个参数,但1个是 假如 Utf8Value(Isolate* 隔离,本地 obj); ^ 产生 1 个错误。 make: *** [Release/obj.target/binding/src/create_string.o] 错误 1 吉普错误!构建错误 吉普错误!堆栈错误:make 失败,退出代码:2 吉普错误! ChildProcess.onExit 的堆栈(/Users/marinosony/Desktop/SofiaPaySys/SofiaAPI/node_modules/node-gyp/lib/build.js:262:23) 吉普错误! ChildProcess.emit (events.js:210:5) 的堆栈 吉普错误!堆栈在 Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) 吉普错误!系统达尔文 19.2.0 吉普错误!命令“/usr/local/Cellar/node/13.1.0/bin/node”“/Users/marinosony/Desktop/SofiaPaySys/SofiaAPI/node_modules/node-gyp/bin/node-gyp.js”“重建”“- -verbose""--libsass_ext=""--libsass_cflags=""--libsass_ldflags=""--libsass_library=" 吉普错误! cwd /Users/marinosony/Desktop/SofiaPaySys/SofiaAPI/node_modules/node-sass 吉普错误!节点-v v13.1.0 吉普错误!节点gyp -v v3.8.0 吉普错误!不行

  • 节点版本:13.1.0
  • node-sass 版本:4.13.1

【问题讨论】:

  • 您使用的是什么版本的 nodenode-sass?请同时提供。
  • 节点 v13.1.0 & node-sass 4.13.1。也许我需要将 node-sass 降级到 4.13.0 ??
  • 是的,非常感谢。显然,我不得不降级 node 和 node-sass 版本。
  • 我在 node v16 上遇到了同样的问题,降级到 node v14 并且工作正常

标签: node.js npm node-modules node-sass


【解决方案1】:

我找到了答案。我不得不将我的节点版本降级到 10.16.0,我的 node-sass 版本降级到 4.12.0。 Yarn - Node Sass does not yet support my current environment 感谢您的帮助。

【讨论】:

  • 只是一个 npm update 为我工作
  • 如果您使用的是自制软件,以下对我有用: brew install node@12 brew unlink node brew link node@12 或者您需要降级到的任何版本..
【解决方案2】:

这是版本问题尝试使用--unsafe-perm安装它

sudo npm install -g --unsafe-perm node-sass 

【讨论】:

  • 如果你偷东西有问题请告诉我..
  • 这行不通。我有同样的问题“错误:没有匹配的构造函数用于初始化 'v8::String::Utf8Value' v8::String::Utf8Value string(value);”
  • 你试过 npm install node-sass 吗??
  • 是的。我对“npm install node-sass”安装没有任何问题。当我尝试使用 npm 安装一些软件包时,我的麻烦就来了。实际上,当我尝试使用 npm 安装“h5bp”包时,就会出现这种情况。
猜你喜欢
  • 2019-01-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-02-08
  • 2020-12-04
  • 2015-12-16
  • 1970-01-01
相关资源
最近更新 更多