Skip to content

CLI doesn't work with node 20 #218

Description

@ArthurPedroti

Bug report

Describe the bug

CLI doesn't work with node 20

When a run a command from cli on Node 20.x I got an error.

`
❯ npm run cs import

project@0.1.2 cs
config-sync import

/home/arthurpedroti/www/project/api/node_modules/strapi-plugin-config-sync/dist/cli/index.js:6
const chalk = require("chalk");
^

Error [ERR_REQUIRE_ESM]: require() of ES Module /home/arthurpedroti/www/project/api/node_modules/strapi-plugin-config-sync/node_modules/chalk/source/index.js from /home/arthurpedroti/www/project/api/node_modules/strapi-plugin-config-sync/dist/cli/index.js not supported.
Instead change the require of /home/arthurpedroti/www/project/api/node_modules/strapi-plugin-config-sync/node_modules/chalk/source/index.js in /home/arthurpedroti/www/project/api/node_modules/strapi-plugin-config-sync/dist/cli/index.js to a dynamic import() which is available in all CommonJS modules.
at Object. (/home/arthurpedroti/www/project/api/node_modules/strapi-plugin-config-sync/dist/cli/index.js:6:15) {
code: 'ERR_REQUIRE_ESM'
}

Node.js v20.18.1
`

System

  • Node.js version: 20.18.1
  • NPM version: 10.8.2
  • Strapi version: 5.40.0
  • Plugin version: 3.2.0
  • Database: Postgres
  • Operating system: Linux

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions