Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install all the dependency package in yarn?

Tags:

yarnpkg

First, I'm new to React. I'm trying to use Google's Material-UI for my React project. In this tutorial, it says run npm install, but I heard using yarn and npm together in the same project because it might bring about some confusion between those two later. So, I'm trying to stick to yarn only.

npm install seems to install all the dependency package for the thing that I wanna use, but how can I do that in yarn? I tried yarn add, but it didn't work. How can I do that?

EDIT

Just found that it has only package.json, which means I can only use npm install to install dependencies. Would there be no problem when I use yarn later?

like image 867
Jae P. Avatar asked Dec 05 '22 11:12

Jae P.


1 Answers

You should just be able to run yarn ("Running yarn with no command will run yarn install, passing through any provided flags." So just a simple yarn is what you'd want now, this answer previously suggested yarn install)

Here is a comparison table of most/all the commands you'd likely encounter


Edit Sept 2020: The newer versions of npm have greatly improved and caught up to yarn, so I currently have no clue what possible benefits yarn offers anymore, I'm 100% npm for the last year or so

like image 128
Thymine Avatar answered Jan 14 '23 17:01

Thymine