Skip to content

[DOCS] npm init <package-spec> is not same as npx <package-spec>. #7011

@vivodi

Description

@vivodi

Is there an existing issue for this?

  • I have searched the existing issues

This is a CLI Docs Problem, not another kind of Docs Problem.

  • This is a CLI Docs Problem.

Description of Problem

The npm-init documentation says npm init <package-spec> is the same as npx <package-spec>:

npm init <package-spec> (same as npx <package-spec>)

Is that correct?

If it is correct, why aren't the following two commands equivalent?

npm init docusaurus # works as expected
npx docusaurus      # error: could not determine executable to run

Potential Solution

#5838 discussed this issue, but it was closed.

Affected URL

https://docs.npmjs.com/cli/v10/commands/npm-init

Metadata

Metadata

Assignees

No one assigned

    Labels

    Documentationdocumentation related issueNeeds Triageneeds review for next steps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions