google-play-scraper icon indicating copy to clipboard operation
google-play-scraper copied to clipboard

Error [ERR_REQUIRE_ESM]: require() of ES Module

Open cuongsql opened this issue 5 months ago • 1 comments

I got an error when installing a new google-play-api. What should I do to fix it? I searched for a lot of information on Google, but it didn't work.

  • Node version: v20.17.0
  • NPM 10.8.2

Error message:

Error [ERR_REQUIRE_ESM]: require() of ES Module /node_modules/google-play-scraper/index.js from /lib/index.js not supported. Instead change the require of /node_modules/google-play-scraper/index.js in/lib/index.js to a dynamic import() which is available in all CommonJS modules. at Object. (/lib/index.js:4:15) at Object. (/server.js:4:16) at startApplication (/usr/local/lsws/fcgi-bin/lsnode.js:48:15) at Object. (/usr/local/lsws/fcgi-bin/lsnode.js:16:1) { code: 'ERR_REQUIRE_ESM' }

cuongsql avatar Aug 31 '24 18:08 cuongsql