Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

vp run skips pnpm's verifyDepsBeforeRun, so scripts run against stale node_modules

Đang mở
#3,091 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
nodejs, rust
Lĩnh vực
build-system

Hướng nghiên cứu

Reproduce by making a pnpm workspace's lockfile stale, then compare pnpm run <script> (which installs first) with vp run <script> (which does not). Read how vp run launches package.json scripts and whether it can consult pnpm's verifyDepsBeforeRun setting. Done means a stale workspace behaves consistently under vp run, and npm, yarn and bun are unchanged. The maintainers still need to choose between this fix and documenting the gap.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Description

pnpm 11 made verifyDepsBeforeRun: install the default. Before pnpm run or pnpm exec, pnpm checks that node_modules matches the lockfile and the manifests, and installs first if it doesn't. The check takes about 10 ms when nothing changed.

vp run <script> runs the same package.json scripts itself and does no such check. So after a git pull, a merge or a branch switch that changes the lockfile, pnpm run test works, while vp run test fails with Cannot find module … against stale dependencies.

Tested with vite-plus 1.2.0 and pnpm 12.11.2 on Linux:

  • In a workspace with a stale lockfile, pnpm run <script> installed and then ran.
  • vp run <script> failed with Cannot find module.
  • An strace -e execve of vp run --filter <pkg> lint shows no pnpm process starting.
  • Nothing overrides verifyDepsBeforeRun in the workspace, .npmrc, user config or environment.
Suggested solution

When the workspace's package manager is pnpm, have vp run apply pnpm's verifyDepsBeforeRun setting before running a package.json script: run pnpm's own check, or install, warn or fail as the setting says. With npm, yarn or bun, keep today's behaviour.

Alternative

Document that vp run skips the package manager's dependency check, so teams that rely on it run scripts through pnpm run.

Additional context

This is how our agents and developers got stale node_modules after merges. We now run package scripts with pnpm for this reason.

Validations
  • Read the Contributing Guidelines.
  • Confirm this request is for Vite+ itself and not for Vite, Vitest, tsdown, Rolldown, or Oxc.
  • Check that there isn't already an issue requesting the same feature. I searched vite-plus and vite-task for verifyDepsBeforeRun, verify-deps-before-run and stale dependencies.
Ngôn ngữ chính
Rust
Star
6k
Fork
274
Merge trung bình
1 ngày 12 giờ
Pull request đã merge (30 ngày)
205

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của voidzero-dev/vite-plus

Tất cả issue của voidzero-dev/vite-plus

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.