Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

`vp migrate` fails when there is no `package.json`

已关闭 适合新手
#2,801 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@TheAlexLichter 已经在做这个了。

开始于 2026年9月25日。

  • #2821 来自 @TheAlexLichter —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
75/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
javascript, nodejs
领域
cli, tooling

调研方向

错误发生在迁移脚本 migration/bin.js 的第 2617 行附近,那里调用了 readJson。请找到 planVitestV5Migration 函数,并在读取 package.json 之前添加对其存在性的检查。修复方案应在文件缺失时输出对用户友好的错误信息。测试方法:在一个没有 package.json 的目录中运行 vp migrate。

由索引模型根据 Issue 内容生成。

描述

pending triage
Describe the bug

In an invalid project, Vite+ should tell that this isnt a valid project instead of failing

Reproduction
Steps to reproduce
  1. mkdir test
  2. cd test
  3. vp migrate
  4. error
ENOENT: no such file or directory, open '/Users/alichter/Programming/demo-day/package.json'
Error: ENOENT: no such file or directory, open '/Users/alichter/Programming/demo-day/package.json'
    at Object.readFileSync (node:fs:483:20)
    at readJson (file:///Users/alichter/.vite-plus/1.0.0-rc.0/node_modules/.pnpm/[email protected]_@[email protected][email protected]_/node_modules/vite-plus/dist/migration/bin.js:2617:22)
    at planVitestV5Migration (file:///Users/alichter/.vite-plus/1.0.0-rc.0/node_modules/.pnpm/[email protected]_@[email protected][email protected]_/node_modules/vite-plus/dist/migration/bin.js:2921:15)
    at main (file:///Users/alichter/.vite-plus/1.0.0-rc.0/node_modules/.pnpm/[email protected]_@[email protected][email protected]_/node_modules/vite-plus/dist/migration/bin.js:3916:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/alichter/Programming/demo-day/package.json'
}
System Info
-
Used Package Manager

pnpm

Logs

Validations
主要语言
Rust
星标
6k
派生
274
平均合并
1 天 11 小时
30 天内合并 PR
196

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

voidzero-dev/vite-plus 的其他 Issue

查看 voidzero-dev/vite-plus 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。