【发布时间】:2022-03-31 09:55:30
【问题描述】:
我正在尝试恢复 an old, unmaintained library 的构建,以便我们可以签入一些更改(或发布一个 fork),使其与另一个更新的库(即 Bootstrap 4)很好地配合,但这对于这个问题并不重要)。
当尝试一个普通的npm i 时,首先我得到了一些地方库的 package.json 与其依赖项的依赖项发生冲突,因为 ~ 与 ^ 冲突 - 依赖项对版本更宽松,所以我将主项目中的一些依赖项从~ 更改为^ 以匹配。没什么大不了的。
但后来...npm i 在最终放弃之前陷入了困境。
在它似乎挂起之前显示的最后一行是这样的:
⸨ ⸩ ⠴ reify:rxjs: timing reifyNode:node_modules/selenium-webdriver Completed in 8604ms
然后它一遍又一遍地调用clang 和make 一段时间(在macOS Big Sur 上,我可以在终端的标题栏中看到命令),最后重新输入npm i 并吐了一身这个地方。
呕吐开始于:
npm WARN deprecated connect@1.9.2: connect 1.x series is deprecated
npm WARN deprecated core-js@1.2.7: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path /Applications/projects/angularjs-dropdown-multiselect/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
This question 看起来至少相似,因为它与node-sass 有类似的问题,但是库在its package.json 的任何地方都没有node-sass,这表明它是一个正在抓取节点的依赖项的依赖项- sass...所以我不确定如何从我所在的位置编辑 node-sass 依赖项,而无需猜测很多依赖项版本。
尝试安装 core-js@latest
好的,好的。让我们尝试安装 大于 3.3 的 core-js,看看我们是否可以强制它以某种方式工作。
事实上,让我们尝试获取最新的(看起来是3.13 atm)...
npm i -D core-js@latest
这是奇怪的事情:
这给了我同样的错误!
就像字面上一样:
npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
嗯? core-js@latest 需要 core-js@
这是怎么回事?
更多日志记录!
我将尝试从上面粘贴的npm Err! 之后的日志中选择看起来有用的东西,以防万一。需要明确的是,这是从 npm i 首次尝试 entire library 开始,而 IS NOT 对于 npm install -D core-js@latest。
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli '/usr/local/bin/node',
npm ERR! gyp verb cli '/Applications/projects/angularjs-dropdown-multiselect/node_modules/node-gyp/bin/node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
...然后几次这样的味道:
npm ERR! gyp verb `which` succeeded for `make` /usr/bin/make
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../src/libsass/src/ast.cpp:2:
npm ERR! ../src/libsass/src/ast.hpp:1361:25: warning: loop variable 'numerator' of type 'const std::__1::basic_string<char>' creates a copy from type 'const std::__1::basic_string<char>' [-Wrange-loop-analysis]
npm ERR! for (const auto numerator : numerator_units())
npm ERR! ^
npm ERR! ../src/libsass/src/ast.hpp:1361:14: note: use reference type 'const std::__1::basic_string<char> &' to prevent copying
npm ERR! for (const auto numerator : numerator_units())
npm ERR! ^~~~~~~~~~~~~~~~~~~~~~
npm ERR! &
npm ERR! ../src/libsass/src/ast.hpp:1363:25: warning: loop variable 'denominator' of type 'const std::__1::basic_string<char>' creates a copy from type 'const std::__1::basic_string<char>' [-Wrange-loop-analysis]
npm ERR! for (const auto denominator : denominator_units())
npm ERR! ^
npm ERR! ../src/libsass/src/ast.hpp:1363:14: note: use reference type 'const std::__1::basic_string<char> &' to prevent copying
npm ERR! for (const auto denominator : denominator_units())
npm ERR! ^~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! &
npm ERR! 2 warnings generated.
...在结束之前:
npm ERR! In file included from ../src/binding.cpp:3:
npm ERR! In file included from ../src/sass_context_wrapper.h:9:
npm ERR! In file included from ../src/custom_function_bridge.h:7:
npm ERR! ../src/callback_bridge.h:110:23: warning: 'Call' is deprecated [-Wdeprecated-declarations]
npm ERR! this->callback->Call(argv_v8.size(), &argv_v8[0])
npm ERR! ^
npm ERR! ../src/binding.cpp:32:16: note: in instantiation of member function 'CallbackBridge<Sass_Value *, void *>::operator()' requested here
npm ERR! return bridge(argv);
npm ERR! ^
npm ERR! ../../nan/nan.h:1741:3: note: 'Call' has been explicitly marked deprecated here
npm ERR! NAN_DEPRECATED inline v8::Local<v8::Value>
npm ERR! ^
npm ERR! ../../nan/nan.h:106:40: note: expanded from macro 'NAN_DEPRECATED'
npm ERR! # define NAN_DEPRECATED __attribute__((deprecated))
npm ERR! ^
npm ERR! 6 warnings generated.
npm ERR! ../src/create_string.cpp:17:25: error: no matching constructor for initialization of 'v8::String::Utf8Value'
npm ERR! v8::String::Utf8Value string(value);
npm ERR! ^ ~~~~~
npm ERR! /Users/myLogin/.node-gyp/14.15.1/include/node/v8.h:3294:5: note: candidate constructor not viable: no known conversion from 'v8::Local<v8::Value>' to 'const v8::String::Utf8Value' for 1st argument
npm ERR! Utf8Value(const Utf8Value&) = delete;
npm ERR! ^
npm ERR! /Users/myLogin/.node-gyp/14.15.1/include/node/v8.h:3287:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
npm ERR! Utf8Value(Isolate* isolate, Local<v8::Value> obj);
npm ERR! ^
npm ERR! 1 error generated.
npm ERR! make: *** [Release/obj.target/binding/src/create_string.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/Applications/projects/angularjs-dropdown-multiselect/node_modules/node-gyp/lib/build.js:262:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:315:20)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
npm ERR! gyp ERR! System Darwin 20.3.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/Applications/projects/angularjs-dropdown-multiselect/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /Applications/projects/angularjs-dropdown-multiselect/node_modules/node-sass
npm ERR! gyp ERR! node -v v14.15.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
恐怕这超出了我的工资等级。怎么回事?
【问题讨论】:
-
您找到解决方案了吗?我有同样的问题。
-
@ASSASSIN1030 还没有运气。我们只是暂时不使用该组件。