`npm icore-js@latest`赢得't安装,因为它可以't生成..core js@<3



我正试图恢复一个旧的、未维护的库的构建,这样我们就可以签入一些更改(或发布一个fork(,让它与另一个更新的库(即Bootstrap 4,但这对这个问题并不重要(配合得很好。

在尝试普通的npm i时,首先,由于~^的冲突,我发现库的package.json与其依赖项的依赖项发生了冲突——依赖项对版本更宽容,所以我将主项目中的一些依赖项从~更改为^以匹配。没什么大不了的。

但是npm i陷入了困境,在它最终放弃之前,它看起来像是在建造什么。

在它似乎挂起之前显示的最后一行是:

⸨                  ⸩ ⠴ reify:rxjs: timing reifyNode:node_modules/selenium-webdriver Completed in 8604ms

然后它一遍又一遍地调用clangmake一段时间(在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

这个问题看起来至少很相似,因为它与node-sass有类似的问题,但该库的package.json中没有node-sass,这表明它是一个依赖项的依赖项,该依赖项正在抓取节点sass。。。所以我不知道如何在不猜测很多依赖版本的情况下,从我所处的位置编辑节点sass依赖。


正在尝试安装core-js@latest

好的,好的。让我们试着安装大于3.3的corejs,看看我们是否可以强迫它以某种方式工作。

事实上,让我们试着获取最新的(看起来是3.13个大气压(。。。

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需要核心js@<3.3建造?

这是怎么回事?


更多日志记录

我将在上面粘贴的npm Err!之后,尝试从原木熨平板中选择看起来有用的东西,以防有用。需要明确的是,对于整个库,这是第一次尝试npm i,对于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

恐怕这超出了我的工资等级。怎么回事?

不确定你是否仍在寻找答案,但如果有其他人,这个命令对我有效:

npm安装-保存核心js@^3

最新更新