-
I'd like to use the latest version of got-scraping (4.0.3) in my codebase in node 16.20.2, I had a problem when trying to install the new version, in the dependencies there is the "quick-lru" library with version 7.0.0 which requires node 18 or higher, I managed to bypass this by putting in my package.json : "resolutions": { So I've managed to install the latest version of got-scraping but I'm faced with a new problem, when I try to use it it sends me back Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /Users/root69/got-scraping-issue/node_modules/got-scraping/package.json I'd like to be able to fix this error as soon as possible, thank you. here is a repo with an example of my problem : https://github.com/xyeuu/got-scraping-issue |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
got-scraping v4 is ESM project, your repro is CJS apparently (and is also pretty incomplete, e.g. no tsconfig.json, but only a TS file) - if that's the case, you need to use dynamic import ( |
Beta Was this translation helpful? Give feedback.
got-scraping v4 is ESM project, your repro is CJS apparently (and is also pretty incomplete, e.g. no tsconfig.json, but only a TS file) - if that's the case, you need to use dynamic import (
await import('got-scraping')
). Your test code is also a bit weird, as you don't await the call at all, so this will surely fail both TS compilation and runtime, but I guess that's another problem on top of what you want to fix now.