I am trying to test a cli (feathers-cli) that I am working on. I have cloned it's primary dependancy (feathers-generator) and made my modifications, this is what I have done.
yarn link
yarn link "feathers-generator"
yarn link
yarn link "feathers-cli"
then run yarn global add "feathers-cli"
feathers
however, at this point it is using the regular version it has pulled from npm. I have looked through the yarn docs and can't seem to find anything about globally linking packages. How do I approach this?
Step 1 — Installing Yarn Globally The Yarn maintainers recommend installing Yarn globally by using the NPM package manager, which is included by default with all Node. js installations. Use the -g flag with npm install to do this: sudo npm install -g yarn.
If you check the yarn link documentation, the yarn link uses a local copy of the package. This will create a symlink named react-relay/node_modules/react that links to your local copy of the react project.
By default that will be: ~/. config/yarn/global .
yarn link is a command that helps during the development of npm packages. It links a local npm package to an existing project that uses yarn package manager. What this does is that it removes the need to create a new example project to test your npm package in development.
With yarn v1.19 you can do:
yarn global add file:/fullpath/to/myproject
Yarn, unfortunately, does not seem to support this directly in any way. The best thing I've found is to symbolically link the file to the user's yarn bin folder.
On Windows: %LOCALAPPDATA%/Yarn/bin
On Linux: ~/.yarn/bin/
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