Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct the command to show help in README.md #658

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shi0rik0
Copy link

@shi0rik0 shi0rik0 commented Jan 9, 2025

The old command will show the help of npm create, not the help of create-vue.

Description

Current documentation says we can use npm create vue@latest -- --help to show the help of create-vue, but I found it will print the help of npm create. I'm not sure if it's a bug of npm, but npx create-vue@latest -- --help works fine.

My Enviroment

Windows 11 + npm 10.9.0

The old command will show the help of `npm create`, not the help of `create-vue`.
Copy link
Member

@cexbrayat cexbrayat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR

The npm create vue@latest -- --help command is correct on macOS and displays the help:

npm create vue@latest -- --help
Need to install the following packages:
[email protected]
Ok to proceed? (y)


> npx
> create-vue --help

Usage: create-vue [FEATURE_FLAGS...] [OPTIONS...] [DIRECTORY]

Create a new Vue.js project.
Start the CLI in interactive mode when no FEATURE_FLAGS is provided, or if the DIRECTORY argument is not a valid package name.

Options:
  --force
    Create the project even if the directory is not empty.
  --bare
    Create a barebone project without example code.
  --help
    Display this help message.
  --version
    Display the version number of this CLI.

The npx version that works for you on Windows sadly doesn't work properly on macOS and executes create-vue as if a project was created:

npx create-vue@latest -- --help

Vue.js - The Progressive JavaScript Framework

✖ Add TypeScript ? … No / Yes

@shi0rik0
Copy link
Author

shi0rik0 commented Jan 9, 2025

@cexbrayat I tried again and found that:

  1. In cmd, the npm version works but the npx does not, jsut like on your MacOS.
  2. In PowerShell, the npx version works but the npm does not.

This is interesting. I'll investigate it later.

Anyway, I believe that it's a problem related to npm.

@shi0rik0
Copy link
Author

@cexbrayat OK, I think I found out the answer. It's the PowerShell who is causing this problem behind the scene. According to my test and this question, the syntax of PowerShell will treat -- specially, so executing npm create vue@latest -- --help will be treated as npm create vue@latest --help. A solution is to use npm create vue@latest '--' --help.

Do you think we should add a notice about this for Windows users?

@cexbrayat
Copy link
Member

Yes, maybe you can add a mention for Powershell users 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants