Lux-AI-Challenge / Lux-Design-S1

Home to the design and engine of the @Lux-AI-Challenge Season 1, hosted on @kaggle
https://lux-ai.org/
Apache License 2.0
897 stars 152 forks source link

ERR_REQUIRE_ESM: CLI don't works on Mac OS X #133

Closed Tolsi closed 2 years ago

Tolsi commented 2 years ago

When starting the CLI, I get the error:

> lux-ai-2021
internal/modules/cjs/loader.js:1155
      throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
      ^

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/tolsi/.nvm/versions/node/v13.5.0/lib/node_modules/@lux-ai/2021-challenge/node_modules/nanoid/index.js
require() of ES modules is not supported.
require() of /Users/tolsi/.nvm/versions/node/v13.5.0/lib/node_modules/@lux-ai/2021-challenge/node_modules/nanoid/index.js from /Users/tolsi/.nvm/versions/node/v13.5.0/lib/node_modules/@lux-ai/2021-challenge/node_modules/dimensions-ai/lib/main/utils/index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename /Users/tolsi/.nvm/versions/node/v13.5.0/lib/node_modules/@lux-ai/2021-challenge/node_modules/nanoid/index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/tolsi/.nvm/versions/node/v13.5.0/lib/node_modules/@lux-ai/2021-challenge/node_modules/nanoid/package.json.

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1155:13)
    at Module.load (internal/modules/cjs/loader.js:988:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Module.require (internal/modules/cjs/loader.js:1028:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/tolsi/.nvm/versions/node/v13.5.0/lib/node_modules/@lux-ai/2021-challenge/node_modules/dimensions-ai/lib/main/utils/index.js:39:16)
    at Module._compile (internal/modules/cjs/loader.js:1139:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1159:10)
    at Module.load (internal/modules/cjs/loader.js:988:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14) {
  code: 'ERR_REQUIRE_ESM'
}
> node -v
v13.5.0
StoneT2000 commented 2 years ago

I hope this isn't the problem but can you try installing node v14?

Tolsi commented 2 years ago

upgrading to 16.8 fixed this issue