Metastem / wikiless

A free open source alternative Wikipedia front-end focused on privacy.
https://wikiless.metastem.su/
GNU Affero General Public License v3.0
175 stars 19 forks source link

got v13 does not support CommonJS export #81

Closed codedipper closed 1 year ago

codedipper commented 1 year ago
$ npm start

> Wikiless@0.1.1 start
> node src/wikiless.js

/home/node/wikiless/src/utils.js:7
  const got = require('got')
              ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /home/node/wikiless/node_modules/got/dist/source/index.js from /home/node/wikiless/src/utils.js not supported.
Instead change the require of index.js in /home/node/wikiless/src/utils.js to a dynamic import() which is available in all CommonJS modules.
    at module.exports (/home/node/wikiless/src/utils.js:7:15)
    at Object.<anonymous> (/home/node/wikiless/src/wikiless.js:28:36) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v18.17.0

Also, I manually added the entries for express-session and lusca in package.json because otherwise they won't install with npm install