Ding Fan
Posted on October 25, 2021
It's difficult to make yarn link
work as intended when developing a command line project. The easiest way is:
-
yarn link
in your cli project
assume your cli project is cli-project
, assume the name is cliProject
# in cli-project
yarn link
- create a demo project and init with yarn
mkdir demo-project
cd demo-project
yarn init -y
add your cli project as dependency in
package.json
yarn link cliProject
indemo-project
# in demo-project
yarn link cliProject
now you can use yarn cliProject
here. In my situation, I would
# in demo-project
yarn cliProject --version # to check if yarn link succeeded
yarn cliProject new haha-project # to test my new command
💖 💪 🙅 🚩
Ding Fan
Posted on October 25, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
webdev Implementing Authentication with Twitter OAuth 2.0 using Typescript, Express.js and Next.js
October 21, 2022