Skip to content

[BUG] npx "Need to install" message with local CLI that has no dependencies #3252

Closed
@tbremer

Description

@tbremer

Is there an existing issue for this?

  • I have searched the existing issues

Might be related to: #2627

Current Behavior

I have a project there the root contains a CLI. The package.json looks like this:

{
  "name": "name",
  "private": true,
  "scripts": {},
  "bin": "./cli.mjs",
  "devDependencies": {
    "prettier": "^2.3.0"
  }
}

When I run npx . I am given the following message:

$ npx .
Need to install the following packages:
  file:
Ok to proceed? (y)

The CLI does not have any dependencies, and the file is stored locally on the file system. There is nothing to install and the message is incomplete.

Expected Behavior

CLI should execute without prompting the user as there is nothing to install.

Steps To Reproduce

  1. Clone this repository: https://github.com/tbremer/npx-local-cli-issue
  2. Run npx . at the root directory

Environment

OS:

ProductName:	macOS
ProductVersion:	11.2.3
BuildVersion:	20D91
  • Node: v16.1.0
  • npm: 7.11.2

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingPriority 2secondary priority issueRelease 7.xwork is associated with a specific npm 7 releasecmd:execrelated to `npx`

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions