What exactly is the the 'react-scripts start' command?

Clash Royale CLAN TAG#URR8PPPWhat exactly is the the 'react-scripts start' command?
I've been working with a React project, using react-create-app, and I have two options to start the project:
react-create-app
First way:
npm run start with the definition at the package.json like this:
npm run start
package.json
"start": "react-scripts start",
"start": "react-scripts start",
Second way:
and npm start
npm start
What is the difference between these two commands? And what is the purpose of the react-scripts start?
react-scripts start
I tried to found the definition, but I just found a package with the name, and I still don't know what is the meaning of this command.
@Sagivb.g yes, I updated my question
– Felipe Augusto
Jun 6 at 13:51
"start" is a name of a script, in
npm you run scripts like this npm run scriptName, npm start is also a short for npm run start– Sagiv b.g
Jun 6 at 13:52
npm
npm run scriptName
npm start
npm run start
react-scripts start is the proper command to run the React app in dev mode. This command is stored in package.json so you don't have to memorize it and may simply type the usual npm run start instead. npm start is a shortcut for the latter.– Chris G
Jun 6 at 13:55
react-scripts start
npm run start
npm start
2 Answers
2
react-scripts is a set of scripts from the create-react-app starter pack. create-react-app helps you kick off projects without configuring, so you do not have to setup your project by yourself.
react-scripts
create-react-app
react-scripts start sets up the development environment and starts a server, as well as hot module reloading. You can read here to see what everything it does for you.
react-scripts start
with create-react-app you have following features out of the box.
npm start is a shortcut for npm run start.
npm start
npm run start
npm run is used to run scripts that you define in the scripts object of your package.json
npm run
scripts
if there is no start key in the scripts object, it will default to node server.js
start
node server.js
Sometimes you want to do more than the react scripts gives you, in this case you can do react-scripts eject. This will transform your project from a "managed" state into a not managed state, where you have full control over dependencies, build scripts and other configurations.
react-scripts eject
"start" is a name of a script, in npm you run scripts like this npm run scriptName, npm start is also a short for npm run start
npm run scriptName
npm start
npm run start
As for "react-scripts" this is a script related specifically to create-react-app
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
are you using create-react-app? seems like its a scripts related to that specific project
– Sagiv b.g
Jun 6 at 13:49