Image for post
Image for post

npx breaking on CI?

npm@7 brings fundamental changes to npx, which may break your CI process.


npm_config_yes=true npx <package_name>Need to install the following packages:
Ok to proceed? (y)

npm@7 now uses npm exec as an underline to npx. As a result, your terminal should wait for you to proceed with installation of uninstalled packages. (I’m “standard” as an example, but this applies for all).

npx standard
Image for post
Image for post

This is a blocker for CI processes that may start to fail when migrating to npm@7.

The solution should be to use the underlined npm exec —- yes option.

npx --yes standard

Is equivalent to

npm exec standard --yes

The issue with this solution is that npm@6 does not support this flag and will throw an error.

The solution that is compatible for both versions is to set an npm flag “npm_config_yes” which will get picked up by npm@7 and will be ignored by npm@6

npm_config_yes=true npx standard

Hope this helps

Image for post
Image for post

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store