`vp migrate` fails when there is no `package.json`
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 75/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript, nodejs
调研方向
错误发生在迁移脚本 migration/bin.js 的第 2617 行附近,那里调用了 readJson。请找到 planVitestV5Migration 函数,并在读取 package.json 之前添加对其存在性的检查。修复方案应在文件缺失时输出对用户友好的错误信息。测试方法:在一个没有 package.json 的目录中运行 vp migrate。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
In an invalid project, Vite+ should tell that this isnt a valid project instead of failing
Reproduction
Steps to reproduce
- mkdir test
- cd test
- vp migrate
- 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
- Read the Contributing Guidelines.
- Check that there isn't already an issue for the same bug.
- Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- The provided reproduction is a minimal reproducible example.
- 主要语言
- Rust
- 星标
- 6k
- 派生
- 274
- 平均合并
- 1 天 11 小时
- 30 天内合并 PR
- 196
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
voidzero-dev/vite-plus 的其他 Issue
-
`npx --package=vite-plus vp create` fails with exit 127 when npm is the chosen package manager可能已有人在做 @Crimson341 于 1 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 70/100
voidzero-dev/vite-plus#2970 ·
维护者通常 1 天内回复
-
pending triage
难度 2/5 1-3 小时 新手友好度 72/100
voidzero-dev/vite-plus#2882 · 2 条评论 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 62/100
voidzero-dev/vite-plus#2097 · 10 条评论 · 2 个 reaction ·
维护者通常 1 天内回复
-
vp treats a nested project as part of the parent's pnpm workspace, ignoring its own packageManager and lockfile可能已有人在做 @liangmiQwQ 今天认领。 未关闭bug enhancement
voidzero-dev/vite-plus#3013 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Windows: PowerShell installer (1.1.0) does not add vite-plus\bin to user PATH — 'vp' not recognized可能已有人在做 @fengmk2 今天认领。 未关闭
难度 4/5 3-5 天 新手友好度 30/100
voidzero-dev/vite-plus#2984 · 1 条评论 ·
维护者通常 1 天内回复
查看 voidzero-dev/vite-plus 的全部 Issue
相似的 Issue
-
proxy: SQL-over-HTTP turns empty arrays into [""] or [false], or HTTP 500 for int and float arrays未关闭
难度 2/5 1-3 小时 新手友好度 83/100
neondatabase/neon#12965 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
goauthentik/authentik#26867 ·
维护者通常 1 天内回复
-
api bug macos maintainer-needed p2 triaged
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
area::tern difficulty::easy good first issue kind::cleanup triage::ready
难度 1/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 76/100
eclipse-zenoh/zenoh#2842 · 2 条评论 ·
维护者通常 1 天内回复