Nuxt 构建失败,在 ./node_modules/bootstrap-vue/:varisouspath 中找不到 core-js 依赖项

问题描述 投票:0回答:3

当我构建 nuxt.js 项目时,它会抛出不太友好的友好错误。我已经完成了干净安装(删除了 package.lock 和 node_modules),安装了 core-js@2 和 @babel/runtime-corejs2,但是仍然出现这些错误。

 ERROR  Failed to compile with 4 errors        friendly-errors 11:29:16

These dependencies were not found:             friendly-errors 11:29:16
                                               friendly-errors 11:29:16
* core-js/library/fn/array/from in ./node_modules/bootstrap-vue/es/utils/array.js
* core-js/library/fn/array/is-array in ./node_modules/bootstrap-vue/es/utils/array.js
* core-js/library/fn/object/assign in ./node_modules/bootstrap-vue/es/utils/object.js
* core-js/library/fn/object/is in ./node_modules/bootstrap-vue/es/utils/object.js
                                               friendly-errors 11:29:16
To install them, you can run: npm install --save core-js/library/fn/array/from core-js/library/fn/array/is-array core-js/library/fn/object/assign core-js/library/fn/object/is
ℹ Waiting for file changes
javascript npm nuxt.js bootstrap-vue core-js
3个回答
1
投票
npm installl core-js@2 @babel/runtime-corejs2

将解决您的问题


0
投票

今天在 CI 构建中遇到了这个确切的问题。结果发现问题出在使用 Node.js v6 版本。更新到 v9 解决了这个问题。

我不是 Nuxt 语法专家,但你应该尝试一下升级。对我来说,这是更新的问题:

image: node:6

image: node:9

对于我的 docker 镜像。


0
投票

正如文章中提到的, https://github.com/cdqa-suite/cdQA-annotator/issues/37

从父文件夹(而不是 src 文件夹)中执行“npm runserve”即可完成此工作

© www.soinside.com 2019 - 2024. All rights reserved.