[BUG] npx behavior in CI environments
Problem
This isn't really a bug, but raising it to discuss the potential impact of changes to `npx` in CI environments. Current Behavior: [code block] `npx -y mocha` works to get the automatic install behaviour, but that would require users to update their CI scripts. Also, `npx -y mocha` errors in npm@6 with: [code block] I think that would complicate the logic required in CI scripts when running across multiple Node.js/npm versions. _Just using Mocha as an example. In Node.js, we use npx in our GH Actions configuration, which I suspect would be broken when GH Actions updates to use a version of Node.js containing npm@7._ Expected Behavior: - Unsure, but curious if there could be a workaround that removes the need for users to edit their scripts. Steps To Reproduce: - `npx <module>` in a CI enironment. Environment: - All CI environments /cc @MylesBorins @richardlau
Error Output
ERROR: You must supply a command.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: [BUG] npx behavior in CI environments
as also mentioned in the slack channel: `npm_config_yes=true npx mocha` is the working npm6-7 compat version of it
Trust Score
4 verifications
- 1
as also mentioned in the slack channel: `npm_config_yes=true npx mocha` is the w
as also mentioned in the slack channel: `npm_config_yes=true npx mocha` is the working npm6-7 compat version of it
Validation
Resolved in npm/cli GitHub issue #1935. Community reactions: 7 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep