ipfs / js-ipfs

IPFS implementation in JavaScript
https://js.ipfs.tech
Other
7.44k stars 1.25k forks source link

No "exports" main defined in ... package.json #4238

Closed michael-spengler closed 1 year ago

michael-spengler commented 1 year ago

Following the instructions given here: https://github.com/ipfs/js-ipfs#install-as-an-application-developer

... and then starting the program containing the example code leads to: No "exports" main defined in ... package.json ... ERR_PACKAGE_PATH_NOT_EXPORTED

Screenshot 2022-10-20 at 17 39 12

welcome[bot] commented 1 year ago

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review. In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment. Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

Finally, remember to use https://discuss.ipfs.io if you just need general support.

blockchainTrucker commented 1 year ago

Same here Screenshot 2022-10-20 135303

achingbrain commented 1 year ago

These modules as ESM-only, you cannot require them, only import.

Please see: https://github.com/ipfs/js-ipfs/blob/master/docs/upgrading/v0.62-v0.63.md#esm

MiqueiasGFernandes commented 1 year ago

Same problem here. Why do close this issue, if still haven't solution?

achingbrain commented 1 year ago

Please see the upgrade guide and also similar closed issues for solutions.

Here's one: https://github.com/ipfs/js-ipfs/issues/4180

blockchainTrucker commented 1 year ago

I believe they closed it because the latest version is es6 only, so technically there is no bug. I am using version 34.0.0 and it works as it should.