-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[now-cli] Use npx when available to run dev command #3749
Conversation
@@ -1651,7 +1652,6 @@ export default class DevServer { | |||
const env: EnvConfig = { | |||
...process.env, | |||
...this.buildEnv, | |||
PATH: `${yarnBinPath}${delimiter}${process.env.PATH}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TooTallNate Don't we bundle yarn
with now-cli for this exact purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, I'm also curious about this.
@@ -1664,11 +1664,22 @@ export default class DevServer { | |||
})}` | |||
); | |||
|
|||
const p = spawnCommand(this.devCommand, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This spawnCommand
already has a condition for Windows https://github.com/zeit/now/blob/b0e4f2590d14e79329dbd70a6aeb2b63a244d3c6/packages/now-build-utils/src/fs/run-user-scripts.ts#L84
When
npx
is found, use it to run dev command. Ifnpx
is not available, useyarn bin
to find bin path and run command from bin path.