我只是使用(按照文档)创建一个新的 nuxt 应用程序:
yarn create nuxt-app appname
然后我切换到目录并运行(按照文档):
yarn dev
并得到以下错误:
✖ Nuxt Fatal Error │
│ │
│ Error: @nuxt/components tried to access consola (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound. │
│ │
│ Required package: consola │
│ Required by: @nuxt/components@virtual:4eff43f3a560be194e6097f872c9d8ed0666b260b73fc7573cd09c38d17c2e2d252932f70636f4f4a6035fee79be6a699b4f9693d4a20ba4eb5c9b359f2413a9#npm:2.1.8 (via │
│ /home/ev/Documents/Projects/firebase-test/f-test/.yarn/__virtual__/@nuxt-components-virtual-7192147023/0/cache/@nuxt-components-npm-2.1.8-189d4bc3ff-b2ab70da20.zip/node_modules/@nuxt/components/dist/) │
│ │
│ Ancestor breaking the chain: nuxt@npm:2.15.7 │
│ │
│ │
│ Require stack: │
│ - │
│ /home/ev/Documents/Projects/firebase-test/f-test/.yarn/__virtual__/@nuxt-components-virtual-7192147023/0/cache/@nuxt-components-npm-2.1.8-189d4bc3ff-b2ab70da20.zip/node_modules/@nuxt/components/dist/index.js
为什么会这样? 我正在运行 Node v14.16.0 和 yarn v3.0.0,我使用的是 Linux Mint。