Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

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

Merged
cexbrayat merged 1 commit into vuejs:main from shi0rik0:main
Jan 12, 2025

Conversation

Copy link
Contributor

@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

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:
create-vue@3.13.0
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

Copy link
Contributor Author

shi0rik0 commented Jan 9, 2025
edited
Loading

@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.

Copy link
Contributor 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?

Copy link
Member

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

Copy link
Contributor Author

@cexbrayat I've updated. Could you please review again?

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.

Thank you 👍

@cexbrayat cexbrayat merged commit 44ce566 into vuejs:main Jan 12, 2025
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@cexbrayat cexbrayat cexbrayat approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /