With NPM you can sudo npm --prefix /var/www...
to specify the path of a package.json file.
How can you achieve this with Yarn? I can't seem to find the answer.
Thanks.
The output directory can be changed by running yarn with the command line option --modules-folder . For example, if you wanted to install packages into a web/vendor directory instead of node_modules , you would add the modules-folder option on all yarn commands like yarn install --modules-folder web/vendor .
Whenever you run the yarn init command, the package. json file will be created.
Install all the dependencies listed within package. json in the local node_modules folder.
To run yarn
command from any folder, you should specify path to working directory after --cwd
.
So to run yarn build
for specific path you should run
yarn --cwd <path> build
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