tanishqmanuja / apkmirror-downloader

📥 Download apps from APKMirror with ease.
https://www.npmjs.com/package/apkmirror-downloader
MIT License
35 stars 8 forks source link

The requested module 'cheerio' does not provide an export named 'default' #18

Closed r-erd closed 2 months ago

r-erd commented 2 months ago

Hi, I am having trouble using the library. I just copied the example code into a file and tried to run it (node example.js) I tested installing it from pnpm and npm, neither works.

I am getting the following error:

            ^
SyntaxError: The requested module 'cheerio' does not provide an export named 'default'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:171:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:254:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:474:24)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:119:5)

Node.js v22.1.0

Am I missing something or is there an issue with the library that has gone unnoticed?

tanishqmanuja commented 2 months ago

What sample code ? , It's ESM only lib .. do you have type: module in package json of your project or similar can be achieved by renaming the .js file to .mjs

EDIT: The issue existed because i never tested with node as i was using bun which resolved the cheerio import automatically

tanishqmanuja commented 2 months ago

Thanks for the issue, should be resolved now with commit (07f914b273da633c6357f3f39b3d951677c6fa61)