Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wireit fails when invoked via node --run #1094

Closed
justinfagnani opened this issue Apr 24, 2024 · 1 comment · Fixed by #1169
Closed

Wireit fails when invoked via node --run #1094

justinfagnani opened this issue Apr 24, 2024 · 1 comment · Fixed by #1169

Comments

@justinfagnani
Copy link
Collaborator

node --run <npm-script> is a new command in Node 22 that runs scripts defined in package.json, but has much less overhead (~200ms less) than npm run: nodejs/node#52190

It should be very nice paired with Wireit for cached scripts.

But Wireit currently throws:

❌ wireit must be launched with "npm run" or a compatible command.
    More info: Wireit could not identify the script to run.
node:child_process:965
    throw err;
    ^

Error: Command failed: wireit
    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at checkExecSyncError (node:child_process:890:11)
    at execSync (node:child_process:962:15)
    at node:internal/main/run:74:1 {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 62461,
  stdout: null,
  stderr: null
}

Node.js v22.0.0

It seems like npm --run isn't setting npm_lifecycle_event, so that (or a detectable alternative) would need to be fixed on their end. Hopefully that's it.

@aomarks
Copy link
Member

aomarks commented Aug 23, 2024

This is now available in v0.14.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants