Skip to content

Error [ERR_REQUIRE_ESM]: require() of ES Module #735

Closed Answered by carloswm85
carloswm85 asked this question in Q&A
Discussion options

You must be logged in to vote

Well, @bennycode, I was able to fix it, hopefully in the right way, but using a different solution (your previous answer led in the right direction in the long run, thank you for that).

Following these instructions https://www.npmjs.com/package/@tsconfig/node20 for MY node environment v20.9.0:

  1. Install the following dependency:
npm install --save-dev @tsconfig/node20
  1. Make the following changes to tsconfig.json:
{
    "$schema": "https://json.schemastore.org/tsconfig",
    "_version": "20.1.0",
  "compilerOptions": {
    "lib": [
      "es2022"
    ],
    "module": "node16",
    "target": "es2022",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "moduleRes…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by carloswm85
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants