Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

add bn.js as explicit dependency #777

Merged
merged 3 commits into from
Jul 20, 2020
Merged

add bn.js as explicit dependency #777

merged 3 commits into from
Jul 20, 2020

Conversation

faustbrian
Copy link
Contributor

Trying to install eosjs with certain package managers like yarn berry or ones that use a strict validation mode will fail because bn.js is an implicit dependency and relying on implicit dependencies is generally bad practice and error-prone.

    eosjs tried to access bn.js, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

    Required package: bn.js (via "bn.js")
    Required by: eosjs@npm:21.0.2 (via /home/runner/work/platform-sdk/platform-sdk/.yarn/cache/eosjs-npm-21.0.2-047daf3463-2.zip/node_modules/eosjs/dist/)

@jeffreyssmith2nd
Copy link
Contributor

Thanks for the PR! Can you retarget it to the develop branch?

@faustbrian faustbrian changed the base branch from master to develop July 16, 2020 12:25
@faustbrian
Copy link
Contributor Author

@jeffreyssmith2nd changed the target branch

package.json Outdated Show resolved Hide resolved
@faustbrian
Copy link
Contributor Author

Until this is merged and released people can use the following .yarnrc.yml as a workaround if they use yarn berry. This requires you to do yarn add bn.js to add bn.js as a dependency of your own project.

packageExtensions:
  "eosjs@*":
    dependencies:
      "bn.js": "^5.1.2"

@jeffreyssmith2nd jeffreyssmith2nd merged commit dbae270 into EOSIO:develop Jul 20, 2020
@faustbrian faustbrian deleted the bnjs-yarn-berry branch July 20, 2020 13:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants