Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install only "devDependencies" using yarn

I want to install only the "devDependencies" listed in the package.json file using yarn. I use the command yarn install --production=false but it doesn't work.

like image 557
loveyunk Avatar asked May 02 '26 02:05

loveyunk


1 Answers

Yarn doesn't support it currently (2022, v1.22). Actually neither does npm since v7. An argument against it is you most likely need the production deps to do development. For example, how you gonna test the build without the prod deps? Although seems plenty of people are asking for it - see above links.

The reverse (install only prod deps) is more common use case and is supported: yarn install --prod.

like image 157
spinkus Avatar answered May 03 '26 16:05

spinkus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!