Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Lysander086 opened this issue Feb 2, 2025 · 2 comments
Open

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

Lysander086 opened this issue Feb 2, 2025 · 2 comments

Comments

@Lysander086
Copy link

Lysander086 commented Feb 2, 2025

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: [email protected]
  • 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/[email protected][email protected][email protected][email protected][email protected]/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'
}
@Lysander086 Lysander086 changed the title Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './cli/utils' is not defined by "exports" './cli/utils' is not defined by "exports" Feb 2, 2025
@Lysander086 Lysander086 changed the title './cli/utils' is not defined by "exports" bug './cli/utils' is not defined by "exports" Feb 2, 2025
@Lysander086
Copy link
Author

Lysander086 commented Feb 2, 2025

The docker running approach also failed with the below one.

ERROR: failed to solve: process "/bin/sh -c groupadd khipster &&   useradd khipster -s /bin/bash -m -g khipster -G sudo &&   echo 'khipster:khipster' |chpasswd &&   mkdir /home/khipster/app &&   export DEBIAN_FRONTEND=noninteractiv
e &&   export TZ=Europe\\Paris &&   ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone &&   apt-get update &&   apt-get install -y     wget     sudo &&   wget https://nodejs.org/dist/v14.15.0/node-v14.15.0-l
inux-x64.tar.gz -O /tmp/node.tar.gz &&   tar -C /usr/local --strip-components 1 -xzf /tmp/node.tar.gz &&   npm install -g npm &&   npm install -g yo &&   apt-get clean &&   rm -rf     /home/khipster/.cache/     /var/lib/apt/lists/*     /tmp/*     /var/tmp/*" did not complete successfully: exit code: 1

@Lysander086
Copy link
Author

Lysander086 commented Feb 2, 2025

The workaround of this issue is to switch to the version specified in the docker file.
use the node 14...

In Windows 11, I used nvm to switch to 14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant