【问题标题】:Error when creating frontend project in Vite using yarn commandVite 中使用 yarn 命令创建前端项目时出错
【发布时间】:2023-02-23 05:44:30
【问题描述】:

我正在尝试使用 yarn create vite 命令在 Vite 中创建一个前端项目,但出现以下错误:

如果我使用 npm (npm create vite@latest) 创建项目,没有任何错误发生并且项目创建成功,我的问题仅在使用 yarn 时出现。 我安装的 Node 版本是最新的 18.12.1 LTS

我没有遇到这个问题,我该怎么办?

【问题讨论】:

    标签: npm frontend vite yarn-v2


    【解决方案1】:
    1. 如果不是绝对必要,您不应该使用图像来粘贴代码

    2. Vite 需要 Node.js 版本 14.18+, 16+ https://vitejs.dev/guide/#scaffolding-your-first-vite-project

    3. 使用nvmhttps://www.sitepoint.com/quick-tip-multiple-versions-node-nvm/安装另一个版本的节点

      nvm 安装版本号

    【讨论】:

      猜你喜欢
      • 2021-11-19
      • 2021-06-05
      • 1970-01-01
      • 1970-01-01
      • 2018-02-11
      • 2021-12-16
      • 2016-05-29
      • 1970-01-01
      • 2017-02-13
      相关资源
      最近更新 更多