Creating an App
Need to have Node >= 10 on local development machine (but it’s not required on the server). You can use nvm (macOS/Linux) or nvm-windows to switch Node versions between different projects.
( default npm install -g will install to c:/users/user_name/node_modules/bin)
For npm 5.1 or earlier, you can't use npx. Instead, install create-react-app globally:
npm install -g create-react-app
And Run
create-react-app my-app
For NPM 6 and higher
npm init react-app my-app
Or NPX Command to quick start (npx comes with npm 5.2+ and higher)
npx create-react-app my-app
cd my-app
npm start
YARN
yarn create react-app my-app
Selecting a package manager
When you create a new app, the CLI will use Yarn to install dependencies (when available). If you have Yarn installed, but would prefer to use npm, you can append
--use-npm to the creation command. for NPM
npx create-react-app my-app --use-npm
Creating a TypeScript app
You can start a new TypeScript app using templates. To use our provided TypeScript template, append
--template typescript to the creation commandnpx create-react-app my-app --template typescript
Comments
Post a Comment