What is the difference between yarn run and npm start?

It seems yarn run start is the equivalent of npm start, which runs the script inside the start field of the script field in package.json


Few things to understand:

npm: run command is mandatory to execute user defined scripts.
yarn: run command is not mandatory to execute user defined scripts.

start command is not a user defined script name, so you may not need to specify run command to execute it.

So, all the below commands work similar!

  • npm start
  • npm run start
  • yarn start
  • yarn run start

If you have a user defined script named 'app':

  • npm app (Does not work!)
  • npm run app (Works!)
  • yarn app (Works!)
  • yarn run app (Works!)

Note: By default start runs node server.js in case not explicitly defined.