简体   繁体   中英

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM