Is there's a command for yarn to install a subfolder?

ueeieiie picture ueeieiie · Feb 21, 2018 · Viewed 8k times · Source

Background:

We are using yarn in this project and we don't want to write our package.json scripts with a mix of npm/yarn commands.

I have a root directory which contains a few subfolders.

Each holds a different service.

I want to create a script in the root folder that npm install each of the services, one by one.

Question:

Do you know what would be the yarn alternative to npm install <folder>?

I'm looking for something like this psuedo command: yarn <folder>

Answer

ibenjelloun picture ibenjelloun · Apr 25, 2018

You could use --cwd there is a git issue about this :

yarn --cwd "your/path" script

You can also use cd :

cd "your/path" && yarn script