Nuxt 全新安装包含依赖 Vite 的警告

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

我正在安装新的 Nuxt 3.9.3 应用程序,并且收到以下警告。我的开发工具无法工作。我使用的是 MacOS。

Projects % npx nuxi init nuxt-3

✔ Which package manager would you like to use?
yarn
◐ Installing dependencies...                                                                                                                             7:54:54 PM
yarn install v1.22.21
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
warning [email protected]: The engine "vscode" appears to be invalid.
[3/4] 🔗  Linking dependencies...
warning "nuxt > @nuxt/[email protected]" has unmet peer dependency "vite@*".
warning "nuxt > @nuxt/devtools > [email protected]" has unmet peer dependency "vite@^3.0.0-0 || ^4.0.0-0 || ^5.0.0-0".
warning "nuxt > @nuxt/devtools > [email protected]" has unmet peer dependency "vite@^3.1.0 || ^4.0.0 || ^5.0.0-0".
warning "nuxt > @nuxt/devtools > @nuxt/[email protected]" has unmet peer dependency "vite@*".
[4/4] 🔨  Building fresh packages...
success Saved lockfile.
$ nuxt prepare
✔ Types generated in .nuxt                                                                                                                              7:55:39 PM
✨  Done in 44.58s.
✔ Installation completed.                                                                                                                               7:55:39 PM
nuxt.js vite nuxtjs3
1个回答
0
投票

昨天我也遇到了类似的问题。就我而言,我使用旧的

yarn
版本
1.x

正如我从日志中看到的,你也使用它:

纱线安装v1.22.21

因此,请考虑升级您的

yarn
版本。您可以在他们的文档网站上找到其所有好处。但你需要 Node.js v18+

将纱线升级到最新版本的快速步骤:

    删除您的全局纱线包
  1. npm remove yarn --global
    
    
  2. 奔跑
  3. corepack enable
    
    这将启用旧版本 v1.22.22 的纱线
  4. 奔跑
  5. yarn set version stable
    
    这会将yarn升级为最新版本
    4.1.1
    在4月24日)

    注意: 此命令还会修改您的 package.json
     附加属性 
    "packageManager": "[email protected]"
    
    
  6. 运行
  7. yarn
    yarn install
     以新方式安装软件包并重新编译 
    yarn.lock
     文件。
© www.soinside.com 2019 - 2024. All rights reserved.