Skip to content

[BUG] npx behavior in CI environments #1935

Closed
@BethGriggs

Description

@BethGriggs

This isn't really a bug, but raising it to discuss the potential impact of changes to npx in CI environments.

Current Behavior:

npx mocha
Need to install the following packages:
 mocha
Ok to proceed? (y)

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:

npx -y mocha
ERROR: You must supply a command.
Execute binaries from npm packages.
  npx [options] <command>[@version] [command-arg]...

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

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingRelease 7.xwork is associated with a specific npm 7 release

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions