Run yarn in a different path

本秂侑毒 提交于 2019-12-04 14:58:12

问题


Is there a way to specify a working directory for yarn? This would be different then the --modules-folder option. Specifically, I'm trying to run the yarn install command from a location outside of the package location.

Similar to -C in git


回答1:


--cwd is what you want.

(tested with yarn 1.3.2)




回答2:


You can use --cwd like so yarn --cwd <path> <yarn command>.
The order of arguments is important.

Example:

yarn --cwd ~/test_project/ dev

Because following will not work:

yarn dev --cwd ~/test_project/


来源:https://stackoverflow.com/questions/46891622/run-yarn-in-a-different-path

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!