Reputation: 21470
I bashed my head against the wall trying to install a local package using Yarn v3. Here all the things I tried:
yarn add file:../hardhat-packager
yarn add ../hardhat-packager
"hardhat-packager": "file:../hardhat-packager"
in package.json
"hardhat-packager": "../hardhat-packager"
in package.json
All of the above resulted in Yarn getting stuck at the installation step, as shown in the screenshot below. I waited more than five minutes and I made sure that my Internet connection is fast.
I know that there is an option to link a package, but that is not quite white I want. I don't want symlinks, I want the actual package files copied over.
How can I do this? I'm using Yarn v3.2.0
Upvotes: 13
Views: 9906
Reputation: 563
To install local package for Yarn 3 you should use pattern packagename@location.
For an example:
yarn add hardhat-packager@file:../hardhat-packager
or if you have created a tarball with yarn pack
it should look like:
yarn add hardhat-packager@file:../some_path/hardhat-packager-v0.1.0.tgz
Upvotes: 15