Create-react-app: unknown option: --typescript if --typescript is before project name

Created on 8 Jun 2019  路  4Comments  路  Source: facebook/create-react-app

Is this a bug report?

Yes!

Environment

Environment Info:

  System:
    OS: Linux 5.0 NixOS 19.09pre173166.373488e6f4c (Loris) 19.09pre173166.373488e6f4c (Loris)
    CPU: (16) x64 AMD Ryzen 7 1700 Eight-Core Processor
  Binaries:
    Node: 8.15.1 - ~/.nix-profile/bin/node
    Yarn: 1.15.2 - ~/.nix-profile/bin/yarn
    npm: 6.4.1 - ~/.nix-profile/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
  npmPackages:
    react: Not Found
    react-dom: Not Found
    react-scripts: Not Found
  npmGlobalPackages:
    create-react-app: 3.0.1

Steps to Reproduce

  1. run create-react-app --typescript foo, observe that it throws error: unknown option--typescript'`
  2. run create-react-app foo --typescript, observe that it creates the project successfully

Expected Behavior

The project would be created successfully

Actual Behavior

The command threw an error, saying --typescript is an unknown option

Example

proposal needs triage

Most helpful comment

I understand this is "expected behavior" but it's a bad user experience nonetheless.

All 4 comments

The documented usage indicates that the project directory must be specified first. From npx create-react-app --help:
Usage: create-react-app <project-directory> [options]

Although, we aren't required to supply a project directory for the version and help commands. The error you're experiencing appears to be the intended behaviour.

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

I understand this is "expected behavior" but it's a bad user experience nonetheless.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

barcher picture barcher  路  3Comments

fson picture fson  路  3Comments

stopachka picture stopachka  路  3Comments

onelson picture onelson  路  3Comments

rdamian3 picture rdamian3  路  3Comments