gpt4 book ai didi

node.js - SyntaxHighlighter 的 npm 构建问题

转载 作者:行者123 更新时间:2023-12-03 12:14:02 29 4
gpt4 key购买 nike

我是 npm 的初学者,正在尝试通过首先使用 git 克隆它来构建 SyntaxHighlighter 版本 4,但失败了。这是我得到的错误:

1 error generated.
make: *** [Release/obj.target/binding/src/create_string.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/name/syntaxhighlighter/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:311:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/usr/local/bin/node" "/Users/name/syntaxhighlighter/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/name/syntaxhighlighter/node_modules/node-sass
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN notsup Unsupported engine for karma@0.13.22: wanted: {"node":"0.10 || 0.12 || 4 || 5"} (current: {"node":"12.16.1","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: karma@0.13.22
npm WARN syntaxhighlighter@4.0.1 No description

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/name/.npm/_logs/2020-04-05T02_52_17_048Z-debug.log

最佳答案

您遇到的问题是 SyntaxHighlighter 版本 4 太旧,并且您正在运行的 Node 版本不支持它的依赖项。

错误来自的包是 Karma。尝试安装的 Karma 版本是 v0.13.22。该版本的 Karma 仅支持最大 Node 版本 5,而您似乎运行的是版本 12。

您可以通过降级 Node 版本或使用 Node Version Manager (NVM) 等工具临时降级 Node 版本来解决此问题。

NVM

关于node.js - SyntaxHighlighter 的 npm 构建问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61037449/

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