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

Figure out the preconditions behind runNodeCommandAsJob #2324

Open
sodic opened this issue Oct 7, 2024 · 0 comments
Open

Figure out the preconditions behind runNodeCommandAsJob #2324

sodic opened this issue Oct 7, 2024 · 0 comments
Labels
refactoring Keeping that code clean!

Comments

@sodic
Copy link
Contributor

sodic commented Oct 7, 2024

We often use the runNodeCommandAsJob function to run npx and npm commands.

The only node-specific thing about runNodeCommandAsJob is that it checks whether node is installed and in PATH. It doesn't check for npm or npx.

We use runNodeCommandAsJob in three ways:

  1. We mostly use it to run npm commands.
  2. Sometimes, we use it to run npx commands.
  3. In one place, we use it to run a JS script directly (I believe for Prisma).

The first two use case require npm and npx. Theoretically, only the third use case requires node (although, in reality, most NPM scripts require node anyway).

We think npm and npx come together with node (but it's still possible that the user doesn't have all of them in PATH).

We should:

  1. Make sure we know what the function checks for and what it needs.
  2. Update the function's name accordingly.

This is where the discussion started: #2276 (comment)

@sodic sodic added the refactoring Keeping that code clean! label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Keeping that code clean!
Projects
None yet
Development

No branches or pull requests

1 participant