github / github/local-action

[Bug] `devEngines.packageManager` set to pnpm in `package.json` prevents local-action from running `npm exec tsx`

Đang mở
#293 0 bình luận 2 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
451
Fork
28
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I'm using `pnpm` as the package manager. However, with the following `package.json` settings, local-action failed to start when running `pnpm run local-action`.

```json
{
"name": "github-action",
"version": "1.0.0",
"description": "",
"keywords": [],
"license": "MIT",
"author": "",
"type": "module",
"scripts": {
"local-action": "local-action . src/main.ts .env",
},
"devDependencies": {
"@github/local-action": "^7.0.1"
},
"devEngines": {
"packageManager": {
"name": "pnpm",
"version": "^11.5.2",
"onFail": "download"
}
}
}
```

Below is the error log:

```
npm error code EBADDEVENGINES
npm error EBADDEVENGINES The developer of this package has specified the following through devEngines
npm error EBADDEVENGINES Invalid devEngines.packageManager
npm error EBADDEVENGINES Invalid name "pnpm" does not match "npm" for "packageManager"
npm error EBADDEVENGINES {
npm error EBADDEVENGINES current: { name: 'npm', version: '11.13.0' },
npm error EBADDEVENGINES required: { name: 'pnpm', version: '^11.5.2', onFail: 'download' }
npm error EBADDEVENGINES }
npm error A complete log of this run can be found in: //.npm/_logs/2026-06-11T14_13_09_439Z-debug-0.log

Error: Command failed: npm exec tsx "/node_modules/.pnpm/@github+local-action@7.0.1/node_modules/@github/local-action/src/index.ts" -- . src/main.ts .env
at genericNodeError (node:internal/errors:985:15)
at wrappedFn (node:internal/errors:539:14)
at checkExecSyncError (node:child_process:925:11)
at execSync (node:child_process:997:15)
at entrypoint (file:///node_modules/.pnpm/@github+local-action@7.0.1/node_modules/@github/local-action/bin/local-action.js:108:5)
at file:///node_modules/.pnpm/@github+local-action@7.0.1/node_modules/@github/local-action/bin/local-action.js:121:1
at ModuleJob.run (node:internal/modules/esm/module_job:439:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:633:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 70918,
stdout: null,
stderr: null
}
[ELIFECYCLE] Command failed with exit code 1.
```

It seems that setting `devEngines.packageManager` set to pnpm in `package.json` prevents local-action from running `npm exec tsx "/node_modules/.pnpm/@github+local-action@7.0.1/node_modules/@github/local-action/src/index.ts" -- . src/main.ts .env`.

Consider running `tsx` without relying on package manager by adding `tsx` as dependency. This makes local-action independent from package managers.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với việc tái hiện bằng package.json và lệnh local-action, sau đó kiểm tra entry point local-action.js được hiển thị trong stack trace xung quanh lệnh gọi npm exec. Tái hiện lỗi với pnpm và đặt devEngines.packageManager thành pnpm; hoàn tất khi pnpm run local-action khởi động thành công mà không gặp lỗi EBADDEVENGINES.

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

Đánh giá

Công nghệ
node.js, typescript
Lĩnh vực
developer-experience, tooling
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
52/100

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.