How to handle dependencies that use NPM to get their dependencies? #7568
Unanswered
CodeSandwich
asked this question in
Help
Replies: 1 comment
-
I think that the answer may be to use Soldeer. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working on a smart contract that uses contracts from https://github.com/LayerZero-Labs/LayerZero-v2, so I added it as a sumbodule dependency. It works fine when using Solidity files from
LayerZero-v2
that don't have any external dependencies, but it fails when using files depending onOpenZeppelin
:This is caused by the fact that
LayerZeroV2
has its dependencies managed with NPM, in itspackage.json
it has:What's the best way to handle a dependency like
LayerZeroV2
?Doing
cd lib/LayerZero-v2 && npm install
is pretty bad, it needs to be manually done and it sneakily introduces the requirement to have NPM installed on the machine, which is problematic on the CI.As of now I have it worked around by adding a remapping to my project that directs
@openzeppelin/=lib/openzeppelin-contracts/
to the instance used in my project and installed as a submodule, luckily they are compatible enough to compile. It's an awful hack, a clearly wrong solution that surely will harm me very soon.Beta Was this translation helpful? Give feedback.
All reactions