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

[cli] Show npm output when failing to install Runtimes in vc dev #4598

Merged
merged 10 commits into from Jun 8, 2020

Conversation

TooTallNate
Copy link
Member

@TooTallNate TooTallNate commented Jun 8, 2020

If npm install doesn't exit with 0, then log the output to the
termial.

This was already happening with --debug due to stdio: "inherit"
when debug is enabled, so this change is really only relevant for the
non-debug case.

Before

$ vc dev
Vercel CLI 19.0.2-canary.13 dev (beta) — https://vercel.com/feedback
Error! Command failed with exit code 1: npm install --save-exact --no-package-lock --no-audit --no-progress @now/build-utils@canary @vercel/build-utils@canary now-php@0.0.0

After

Bad dependency:

Screen Shot 2020-06-08 at 12 22 00 PM

No npm installed:

Screen Shot 2020-06-08 at 12 21 16 PM

If `npm install` doesn't exit with 0, then log the output to the
termial.

This was already happening with `--debug` due to `stdio: "inherit"`
when debug is enabled, so this change is really only relevant for the
non-debug case.

Before:

```
$ vc dev
Vercel CLI 19.0.2-canary.13 dev (beta) — https://vercel.com/feedback
Error! Command failed with exit code 1: npm install --save-exact --no-package-lock --no-audit --no-progress @now/build-utils@canary @vercel/build-utils@canary now-php@0.0.0
```

After:

```
$ vc dev
Vercel CLI 19.0.2-canary.13 dev (beta) — https://vercel.com/feedback
npm ERR! code ETARGET
npm ERR! notarget No matching version found for now-php@0.0.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/nrajlich/.npm/_logs/2020-06-08T18_41_58_190Z-debug.log

Error! Command failed with exit code 1: npm install --save-exact --no-package-lock --no-audit --no-progress --color=always @now/build-utils@canary @vercel/build-utils@canary now-php@0.0.0
```
Copy link
Member

@styfle styfle left a comment

Choose a reason for hiding this comment

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

How about a test using builds: [{"src": "index.js", "use": "@vercel/notreal"}] to ensure this behavior works? You could use skipDeploy: true too.

Copy link
Member

@styfle styfle left a comment

Choose a reason for hiding this comment

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

🥇

@kodiakhq kodiakhq bot merged commit 7c96f9f into master Jun 8, 2020
@kodiakhq kodiakhq bot deleted the update/vc-dev-show-npm-stderr branch June 8, 2020 22:36
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.

None yet

3 participants