Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between yarn build and yarn install?

What exactly these two do, where to use them ?

  • yarn install

  • yarn build

like image 929
Arty Avatar asked Jul 26 '19 08:07

Arty


1 Answers

In a nutshell, yarn install is the command used to install all dependencies for a project, usually allocated in the package.json file. In most scenarios it is because you cloned a project and need its dependencies installed to run it.

On the other hand, yarn build is not a built-in command in the Yarn package manager. Looking at your question, it seems like you are running some #reactjs project, which might have defined a build command in its package.json file.

I hope this clarifies your doubt, but for a complete answer, please provide an example of what is your specific scenario.

Also be aware that when running custom scripts like build, test, deploy, etc. it is recommended tu use the yarn run [script] command as stated in the Yarn docs, in your case yarn run build.

like image 66
rdarioduarte Avatar answered Sep 20 '22 20:09

rdarioduarte