Open mrtklein opened 1 month ago
+1
as workaround
generator-jhipster-react-native
repository npm link
in the cloned directory to link the local generator This bypasses the module resolution issue
@mrtklein I've just tried your solution, it works perfectly ! You saved my time !
Describe the bug
When attempting to generate an application using the JHipster React Native blueprint, I encountered an error related to module resolution and Node.js version compatibility.
Instructions To reproduce
██╗ ██║ ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║ ╚██████╔╝ ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗ ╚═════╝ ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝ https://www.jhipster.tech Welcome to JHipster v8.5.0
Documentation for creating an application is at https://www.jhipster.tech/creating-an-app/
Application files will be generated in folder: C:\Users\test\Projects\JHipster\react-native-test
WARNING! __
JHipster update available: 8.6.0 (current: 8.5.0)
Run npm install -g generator-jhipster to update.
? Where do you want to generate a React Native application? ../client ERROR! An error occured while running jhipster-react-native:app#composeReactNative ERROR! ERROR! Cannot find module 'C:\Program Files\nvm\v20.15.0\node_modules\generator-jhipster-react-native\lib\index.js' imported from C:\Program Files\nvm\v20.15.0\node_modules\generator-jhipster-react-native\generators\react-native\generator.mjs Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'C:\Program Files\nvm\v20.15.0\node_modules\generator-jhipster-react-native\lib\index.js' imported from C:\Program Files\nvm\v20.15.0\node_modules\generator-jhipster-react-native\generators\react-native\generator.mjs at finalizeResolution (node:internal/modules/esm/resolve:265:11) at moduleResolve (node:internal/modules/esm/resolve:933:10) at defaultResolve (node:internal/modules/esm/resolve:1157:11) at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12) at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25) at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:227:38) at ModuleWrap. (node:internal/modules/esm/module_job:87:39)
at link (node:internal/modules/esm/module_job:86:36) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///C:/Program%20Files/nvm/v20.15.0/node_modules/generator-jhipster-react-native/lib/index.js'
}
A downgrade to version node 16 did not help...
JHipster app's
.yo-rc.json
{ "generator-jhipster": { "applicationType": "monolith", "authenticationType": "jwt", "baseName": "reactNativeTest", "buildTool": "maven", "cacheProvider": "ehcache", "clientFramework": "no", "clientTestFrameworks": null, "clientTheme": null, "creationTimestamp": 1723542024206, "databaseType": "sql", "devDatabaseType": "postgresql", "enableHibernateCache": true, "enableSwaggerCodegen": false, "enableTranslation": false, "entities": [], "feignClient": null, "jhipsterVersion": "8.5.0", "jwtSecretKey": "xxx=", "messageBroker": false, "microfrontend": null, "microfrontends": [], "nativeLanguage": "de", "packageName": "de.test.reactnativetest", "prodDatabaseType": "postgresql", "reactive": false, "searchEngine": false, "serverPort": null, "serverSideOptions": [], "serviceDiscoveryType": false, "skipClient": true, "syncUserWithIdp": null, "testFrameworks": [], "websocket": false, "withAdminUi": null } }Versions (please complete the following information):
jhipster info
output:██╗ ██║ ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║ ╚██████╔╝ ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗ ╚═════╝ ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝ https://www.jhipster.tech Welcome to JHipster v8.5.0
Welcome to the JHipster Information Sub-Generator
JHipster configuration, a
.yo-rc.json
file generated in the root folder.yo-rc.json file
Environment and Tools
'java' command could not be found
git version 2.46.0.windows.1
node: v20.15.0 npm: 10.7.0
Docker version 27.0.3, build 7d4bcd8
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions