Skip to content

bug './cli/utils' is not defined by "exports" #469

Description

@Lysander086

Issue Description

I encountered an issue when running khipster in my environment. The error message states that the package subpath ./cli/utils is not defined by "exports" in the package.json file of generator-jhipster-kotlin.

Environment Details

  • OS: WSL (Windows Subsystem for Linux) running Ubuntu
  • Node.js Version: v22.13.1
  • NPM Version: 10.9.2
  • KHipster Version: generator-jhipster-kotlin@1.16.0
  • Package Manager: pnpm
  • (have also tried in Windows directly and also failed)

Steps to Reproduce

  1. Installed generator-jhipster-kotlin using npm install -g generator-jhipster-kotlin
  2. Ran the khipster command
  3. The below error message appeared

Expected Behavior

khipster should run without encountering the ERR_PACKAGE_PATH_NOT_EXPORTED error.

Additional Information

It seems that ./cli/utils is missing from the "exports" field in package.json. This might be a compatibility issue with Node.js 22 or a misconfiguration in the package.

Would appreciate any insights or fixes for this issue. Thank you!

Error Message

root@K8Lys:~# mkdir wsl_dev
root@K8Lys:~# cd wsl_dev/
root@K8Lys:~/wsl_dev# node -v
v22.13.1
root@K8Lys:~/wsl_dev# khipster
node:internal/modules/cjs/loader:645
      throw e;
      ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './cli/utils' is not defined by "exports" in /mnt/c/Users/Lysander/AppData/Local/pnpm/global/5/.pnpm/generator-jhipster-kotlin@1.16.0_encoding@0.1.13_mem-fs-editor@9.5.0_mem-fs@2.3.0__mem-fs@2.3.0/node_modules/generator-jhipster/package.json
    at exportsNotFound (node:internal/modules/esm/resolve:314:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:662:9)
    at resolveExports (node:internal/modules/cjs/loader:638:36)
    at Function._findPath (node:internal/modules/cjs/loader:743:31)
    at Function._resolveFilename (node:internal/modules/cjs/loader:1230:27)
    at Function._load (node:internal/modules/cjs/loader:1070:27)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1335:12)
    at require (node:internal/modules/helpers:136:16) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions