8000 ERR_REQUIRE_ESM when creating a new feathers project · Issue #3392 · feathersjs/feathers · GitHub
[go: up one dir, main page]

Skip to content

ERR_REQUIRE_ESM when creating a new feathers project #3392

@patamimbre

Description

@patamimbre

Steps to reproduce

Run npm create feathers@latest feathers-chat as described in the docs

Expected behavior

It should create a base project

Actual behavior

It throws ERR_REQUIRE_ESM error

/Users/patamimbre/.npm/_npx/eb274edb682bcb28/node_modules/create-feathers/bin/create-feathers:7
const { Command, commandRunner, chalk } = require('@feathersjs/cli')
                                          ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/patamimbre/.npm/_npx/eb274edb682bcb28/node_modules/@feathersjs/cli/lib/index.js from /Users/patamimbre/.npm/_npx/eb274edb682bcb28/node_modules/create-feathers/bin/create-feathers not supported.
Instead change the require of index.js in /Users/patamimbre/.npm/_npx/eb274edb682bcb28/node_modules/create-feathers/bin/create-feathers to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/Users/patamimbre/.npm/_npx/eb274edb682bcb28/node_modules/create-feathers/bin/create-feathers:7:43) {
  code: 'ERR_REQUIRE_ESM'
}

System configuration

Module versions (especially the part that's not working):
create-feathers@5.0.15

NodeJS version:
v21.5.0 (tried with node v20 too)

Operating System:
Macos Sonoma 14.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0