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

create-react-app with --typescript doesn't work #6319

Closed
ZeJ0hn opened this issue Jan 31, 2019 · 1 comment
Closed

create-react-app with --typescript doesn't work #6319

ZeJ0hn opened this issue Jan 31, 2019 · 1 comment
Assignees

Comments

@ZeJ0hn
Copy link

ZeJ0hn commented Jan 31, 2019

Is this a bug report?

Yes

Did you try recovering your dependencies?

Yes

Environment


  System:
    OS: macOS 10.14.2
    CPU: x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
  Binaries:
    Node: 8.12.0 - /usr/local/bin/node
    npm: 6.7.0 - ~/.npm-packages/bin/npm
  Browsers:
    Chrome: 72.0.3626.81
    Safari: 12.0.2
  npmPackages:
    react: ^16.7.0 => 16.7.0 
    react-dom: ^16.7.0 => 16.7.0 
    react-scripts: 2.1.3 => 2.1.3 
  npmGlobalPackages:
    create-react-app: 2.0.2

Steps to Reproduce

When I create a new project using npx create-react-app project-geo-semantic-react --typescript, the generate app in a Javascript App and not a Typescript App.
For example, the package.json doesn't contains typescript dependencies :

  "dependencies": {
    "react": "^16.7.0",
    "react-dom": "^16.7.0",
    "react-scripts": "2.1.3"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },

Expected Behavior

Using --typescript parameters, a configured typescript project is generated.

Actual Behavior

Using --typescript parameters, the generated project is not configured for use typescript.
I need to manually add typescript support on my project.

@mrmckeb
Copy link
Contributor

mrmckeb commented Feb 1, 2019

Hello @ZeJ0hn, this is common problem, and I think we've updated our docs recently to solve this.

First, I'd recommend not having a globally installed create-react-app package. But, if you must, you need to update it for this to work.

If you can remove it, do so, and then running yarn create react-app --typescript or npx create-react-app --typescript will work for you.

Sorry for the inconvenience.

@mrmckeb mrmckeb closed this as completed Feb 1, 2019
@mrmckeb mrmckeb self-assigned this Feb 1, 2019
@lock lock bot locked and limited conversation to collaborators Feb 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants