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

jhipster 7.9.3 error with namespace #22774

Closed
JeffeVargasP opened this issue Jul 4, 2023 · 2 comments
Closed

jhipster 7.9.3 error with namespace #22774

JeffeVargasP opened this issue Jul 4, 2023 · 2 comments

Comments

@JeffeVargasP
Copy link

Overview of the issue

When you install the latest stable version of jhipster that's 7.9.3 via npm and try to execute jhipster cli or jhipster jdl <file.jdl> it's returning the error:

node:internal/modules/cjs/loader:573
      throw e;
      ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/util/namespace' is not defined by "exports" in /home/$USER/.nvm/versions/node/v18.16.1/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/package.json
    at new NodeError (node:internal/errors:399:5)
    at exportsNotFound (node:internal/modules/esm/resolve:361:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:697:9)
    at resolveExports (node:internal/modules/cjs/loader:567:36)
    at Module._findPath (node:internal/modules/cjs/loader:636:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1063:27)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (/home/$USER/.nvm/versions/node/v18.16.1/lib/node_modules/generator-jhipster/utils/blueprint.js:19:25) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

npm i -g [email protected]
jhipster

And got the error.

Suggest a Fix

Edit the file in /home/$USER/.nvm/versions/node/v18.16.1/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/package.json and add this code into the "exports":

"./lib/util/namespace": "./lib/util/namespace.js",
JHipster Version(s)

[email protected]

NodeJS Versions(s)

node v18.16.1

Java Version(s)

openjdk 11.0.12 2021-07-20
OpenJDK Runtime Environment 18.9 (build 11.0.12+7)
OpenJDK 65-Bit Server VM 18.9 (build 11.0.12+7, mixed mode)

@mraible
Copy link
Contributor

mraible commented Jul 5, 2023

JHipster 7.x only works with Node 16. If you use Node 16, it should work.

@mraible
Copy link
Contributor

mraible commented Jul 5, 2023

Please re-open if Node 16 doesn't work for you.

@mraible mraible closed this as completed Jul 5, 2023
@DanielFran DanielFran added this to the 8.0.0-beta.2 milestone Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants