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

[now-cli] Use npx when available to run dev command #3749

Merged
merged 6 commits into from
Feb 5, 2020

Conversation

lucleray
Copy link
Member

@lucleray lucleray commented Feb 5, 2020

When npx is found, use it to run dev command. If npx is not available, use yarn bin to find bin path and run command from bin path.

@@ -1651,7 +1652,6 @@ export default class DevServer {
const env: EnvConfig = {
...process.env,
...this.buildEnv,
PATH: `${yarnBinPath}${delimiter}${process.env.PATH}`,
Copy link
Member

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?

Copy link
Member Author

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, {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leo leo merged commit e00db44 into master Feb 5, 2020
@leo leo deleted the now-dev-use-npx-when-available branch February 5, 2020 21:37
styfle added a commit that referenced this pull request Feb 8, 2020
This fixes a regression from #3749 where the PORT env var was removed. This is necessary so frameworks like create-react-app and gatsby can proxy to `now dev`.

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

Successfully merging this pull request may close these issues.

3 participants