When using the app generator for Nuxt.js, client side compilation fails with error :
` ERROR Failed to compile with 5 errors friendly-errors 07:37:07
These dependencies were not found: friendly-errors 07:37:07
friendly-errors 07:37:07
App should compile and start.
Workaround found in https://github.com/vuejs/vue-cli/issues/4391 by forcing core-js to version 2.x
npm install --save core-js@2
npm run dev
Thanks @bpavot. I did a little more testing
So it appears to be a specific combination of Nuxt and NPM. I've pinged @mitchellhamilton who is really good at this stuff and may know what to try. But since this is now well documented I'd say it's a low priority. We'll get to it but most users that encounter this should be able to find an adequate work-around.
Thanks for the detailed report @bpavot, it always helps!
I also encountered this problem.
错误报告
描述错误
当将应用生成器用于Nuxt.js时,客户端编译失败并显示以下错误:
`错误编译失败,出现5个错误friendly-errors 07:37:07
找不到这些依赖性:友好错误07:37:07
友好错误07:37:07
- ./dist/utils.js、./dist/components/nuxt.js中的core-js / modules / es6.regexp.to-string友好错误07:37:07
- 最终在./dist/client.js中出现core-js / modules / es7.promise.promise-errors 07:37:07
- ./dist/client.js、./dist/components/nuxt-link.client.js中的core-js / modules / es7.symbol.async-iterator友好错误07:37:07
友好错误07:37: 07
要安装它们,您可以运行:npm install --save core-js / modules / es6.regexp.to-string core-js / modules / es7.promise.finally core-js / modules / es7.symbol.async-迭代友好-错误7时37分07秒
`重现
- nvm使用12
- npm初始化keystone-app测试
- 选择Nuxt.js
- 选择猫鼬
- 发生安装(未安装纱线,npm安装依赖项)
- 使用cd test和npm run dev启动应用
预期行为
应用程序应编译并启动。
通过将core-js强制为版本2.x 在vuejs / vue-cli#4391中找到解决方法
npm install --save core-js@2
npm run dev系统信息
- 操作系统:Linux
其他背景
- nvm:现在使用节点v12.13.0(npm v6.12.0)
- 未安装纱
Please try yarn add -D [email protected]
https://stackoverflow.com/questions/54492385/nuxt-js-in-docker-missing-dependencies
try
new NuxtApp({
srcDir: 'src',
buildDir: 'dist',
/*
** Build configuration
*/
build: {
babel: {
// envName: server, client, modern
presets() {
return [
[
'@nuxt/babel-preset-app',
{
useBuiltIns: "entry"
}
]
]
},
}
},
})
Thanks @marxvn. I haven't had time to investigate this yet but if this is something that works for people would you have any insight into the root cause? I'm not sure that adding this the right fix for everyone. It would be great if it just worked regardless of yarn or npm.
@marxvn's solution works for a from-scratch client build with @keystonejs/app-next v5.0.0
@MadeByMike It conflicts with version cuid@^1.3.8 (depends core-js@^1.x) in package @apollographql/graphql-playground-react
I was trying Keystone and this happened.
Using NPM and Node v10.16.3
It looks like there hasn't been any activity here in over 6 months. Sorry about that! We've flagged this issue for special attention. It wil be manually reviewed by maintainers, not automatically closed. If you have any additional information please leave us a comment. It really helps! Thank you for you contribution. :)
try
new NuxtApp({ srcDir: 'src', buildDir: 'dist', /* ** Build configuration */ build: { babel: { // envName: server, client, modern presets() { return [ [ '@nuxt/babel-preset-app', { useBuiltIns: "entry" } ] ] }, } }, })
Thank you! This worked for me to core-js dependencies issues when I create a new project by yarn create keystone-app my-app.
My versions (if useful):
node: v13.12.0
yarn: 1.22.4
It looks like there hasn't been any activity here in over 6 months. Sorry about that! We've flagged this issue for special attention. It wil be manually reviewed by maintainers, not automatically closed. If you have any additional information please leave us a comment. It really helps! Thank you for you contribution. :)
Most helpful comment
try