简体   繁体   中英

Can't create WebStorm React project

I'm trying to create a React project in WebStorm 2016.3.1

It's asking me for a create-react-app but I have no idea what that is and I can't find any reference on Google.

What is it and where can I find the value?

在此处输入图片说明

You need to install create-react-app npm module, before you use this feature.

npm install -g create-react-app

You can read more about this feature on the official release blog of WebStorm .

Excerpt from the documentation :

Make sure that you have create-react-app installed globally on your computer, for that run npm install -g create-react-app. Then to start your new project, double click on the start task in the npm tasks tool window to run it. That's it!

I had ie installed create-react-app globally using yarn and webstorm failed to find it. Then I used npm , not to mention globally and its working like a charm.

I created webStrom react app following this steps.

  1. Download node.js
  2. Open command line console and type "npm install -g create-react-app"
  3. Create react app project from web-storm.
  4. Make sure you provided the correct file path of create-react-app , by default it is installed in ~\\AppData\\Roaming\\npm\\node_modules\\create-react-app

use npm start: to start development server

TL;DR
No need to install anything. Just enter npx create-react-app in the create-react-app field & it should work like a pycharm, I mean charm :)

Side note : npx is pre-bundled with npm since npm version 5.2.0.

If you are using asdf or any other tool to manage multiple versions of nodejs, you will need to set up the path to create-react-app manually

I'm on mac, so for me the path was

/Users/<USER>/.asdf/installs/nodejs/12.16.2/.npm/lib/node_modules/create-react-app

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM