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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With