微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

`npm i core-js@latest` 不会安装,因为它无法构建... core-js@<3.3? 尝试安装 core-js@latest更多日志记录!

如何解决`npm i core-js@latest` 不会安装,因为它无法构建... core-js@<3.3? 尝试安装 core-js@latest更多日志记录!

我正在尝试恢复 an old,unmaintained library 的构建,以便我们可以检查一些更改(或发布一个分支),使其与另一个更新的库(即 Bootstrap 4,但这对这个问题)。

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

但是…… npm i 在最终放弃之前陷入了似乎正在建设中的地方。

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

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

然后它一遍又一遍地调用 clangmake 一段时间(在 macOS Big Sur 上,我可以在终端的标题栏中看到命令),最后重新输入 {{1 }},然后吐得满地都是。

呕吐开始于:

npm i

This question 似乎至少是相似的,因为它与 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,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 有类似的问题,但是图书馆在 its package.json 的任何地方都没有 node-sass,这表明它是一个依赖项的依赖项抓取 node-sass ......所以我不确定如何从我所在的位置编辑 node-sass 依赖项而不猜测很多依赖项版本。


尝试安装 core-js@latest

好的,好的。让我们尝试安装 core-js 大于 3.3,看看我们是否可以强制它以某种方式工作。

事实上,让我们尝试获取最新的(看起来是 3.13 atm)...

node-sass

奇怪的是:

这给了我同样的错误

就像字面上相同的东西:

npm i -D core-js@latest

嗯? core-js@latest 需要 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,upgrade your dependencies to the actual version of core-js. 之后的日志熨平板中选择看起来有用的内容,以防万一。需要明确的是,这是对 entire librarynpm Err! 的第一次尝试,以及 npm iIS 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.

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。