Basic app generation failing using jhipster: "TypeError: Cannot read property 'addQmark' of undefined" - jhipster

Very basic application generation failing with error mention in title. I have upgrading Node to latest version 8.11.3, npm to 6.1.0 and installed latest yarn and yo but still getting the same error.
Attaching complete console log for application generation:
? Which type of application would you like to create? Monolithic
application (recommended for simple projects)
? What is the base name of your application? automate
? What is your default Java package name? com.automate
? Do you want to use the JHipster Registry to configure, monitor and
scale your application? No
? Which type of authentication would you like to use? JWT
authentication (stateless, with a token)
? Which type of database would you like to use? SQL (H2, MySQL,
MariaDB, PostgreSQL, Oracle, MSSQL)
? Which production database would you like to use? MySQL
? Which development database would you like to use? MySQL
? Do you want to use the Spring cache abstraction? No - Warning, when
using an SQL database, this will disable the Hiber nate 2nd level
cache!
? Would you like to use Maven or Gradle for building the backend?
Maven
? Which other technologies would you like to use?
? Which Framework would you like to use for the client? Angular 6
? Would you like to enable SASS support using the LibSass
stylesheet preprocessor? No
? Would you like to enable internationalization support? No
? Besides JUnit and Jest, which testing frameworks would you like to
use?
? Would you like to install other generators from the JHipster
Marketplace? No
events.js:183
throw er; // Unhandled 'error' event
^
TypeError: Cannot read property 'addQmark' of undefined
at Compiler. (C:\Users\dellPC\AppData\Local\Yarn\Data\global\node_modules\nanomatch\lib\compilers.js:92:16)
at Compiler.visit (C:\Users\dellPC\AppData\Local\Yarn\Data\global\node_modules\snapdragon\lib\compiler.js:129:15)
at Compiler.mapVisit (C:\Users\dellPC\AppData\Local\Yarn\Data\global\node_modules\snapdragon\lib\compiler.js:143:12)
at Compiler.compile (C:\Users\dellPC\AppData\Local\Yarn\Data\global\node_modules\snapdragon\lib\compiler.js:168:10)
at Snapdragon.compile (C:\Users\dellPC\AppData\Local\Yarn\Data\global\node_modules\snapdragon\index.js:156:32)
at C:\Users\dellPC\AppData\Local\Yarn\Data\global\node_modules\micromatch\index.js:786:23
at memoize (C:\Users\dellPC\AppData\Local\Yarn\Data\global\node_modules\micromatch\index.js:859:13)
at Function.micromatch.compile (C:\Users\dellPC\AppData\Local\Yarn\Data\global\node_modules\micromatch\index.js:783:10)

Related

Error - jhipster-native - TypeError: contents.replaceAll is not a function

I am creating a monolith app with jhipster-native. I got the following error.
ERROR! contents.replaceAll is not a function
TypeError: contents.replaceAll is not a function
at file:///usr/local/lib/node_modules/generator-jhipster-native/generators/server/generator.mjs:311:57
at default.editFile (file:///usr/local/lib/node_modules/generator-jhipster-native/generators/server/generator.mjs:447:17)
at default.replaceUndertowWithTomcat (file:///usr/local/lib/node_modules/generator-jhipster-native/generators/server/generator.mjs:311:16)
at Object. (/usr/local/lib/node_modules/generator-jhipster-native/node_modules/yeoman-generator/lib/index.js:1097:23)
at /usr/local/lib/node_modules/generator-jhipster-native/node_modules/run-async/index.js:49:25
at new Promise ()
at /usr/local/lib/node_modules/generator-jhipster-native/node_modules/run-async/index.js:26:19
at /usr/local/lib/node_modules/generator-jhipster-native/node_modules/yeoman-generator/lib/index.js:1098:9
at new Promise ()
at default.executeTask (/usr/local/lib/node_modules/generator-jhipster-native/node_modules/yeoman-generator/lib/index.js:1069:12)
The jhipster-native options are below.
Thank you in advance!
===================== JHipster Native =====================
info Using blueprint generator-jhipster-native for app subgenerator
Application files will be generated in folder: /Users/albanomataj/Projects/amataj/jhipster-examples/spring-native
_______________________________________________________________________________________________________________
Documentation for creating an application is at https://www.jhipster.tech/creating-an-app/
If you find JHipster useful, consider sponsoring the project at https://opencollective.com/generator-jhipster
_______________________________________________________________________________________________________________
? Which *type* of application would you like to create? Monolithic application (recommended for simple projects)
? What is the base name of your application? jhipster
info Using blueprint generator-jhipster-native for server subgenerator
? Do you want to make it reactive with Spring WebFlux? No
? What is your default Java package name? com.mycompany.myapp
? Which *type* of authentication would you like to use? OAuth 2.0 / OIDC Authentication (stateful, works with Keycloak and Okta)
? Which *type* of database would you like to use? SQL (H2, PostgreSQL, MySQL, MariaDB, Oracle, MSSQL)
? Which *production* database would you like to use? PostgreSQL
? Which *development* database would you like to use? H2 with disk-based persistence
? Which cache do you want to use? (Spring cache abstraction) No cache - Warning, when using an SQL database, this will disable the Hibernate 2nd level cache!
? Would you like to use Maven or Gradle for building the backend? Maven
? Do you want to use the JHipster Registry to configure, monitor and scale your application? No
? Which other technologies would you like to use?
? Which *Framework* would you like to use for the client? Angular
? Do you want to generate the admin UI? Yes
? Would you like to use a Bootswatch theme (https://bootswatch.com/)? Default JHipster
? Would you like to enable internationalization support? No
? Please choose the native language of the application English
? Besides JUnit and Jest, which testing frameworks would you like to use?
? Would you like to install other generators from the JHipster Marketplace? No

Jhipster related query

Can i use javascript instead of typescript in Jhipster tool .I have set the environment and project structure where I found typescript is being used as a file for react side , so my qus is can we have a project skeleton of javascript instead of typescript.pls respond?
You can't configure JHipster to generate frontend code in Javascript.
If you are ok with using an old version of JHipster (and Angular instead of React), JHipster 4 can generate your client-side using AngularJS.
Install the latest version 4.x locally:
npm i generator-jhipster#4.14.5
Create an application:
jhipster
When prompted about the frontend framework, choose AngularJS:
? Which *Framework* would you like to use for the client?
Angular 5
> AngularJS 1.x
If you must absolutely use javascript, I think this is the easiest way.

Jhipster ERROR! The entity generator doesn't support reactive apps with databases of type sql at the moment

I can not create entity using >jhipster entity book.
Jhipster version is 6.9.1
The error log
INFO! Using JHipster version installed locally in current project's node_modules
INFO! Executing jhipster:entity book
INFO! Options: from-cli: true
ERROR! The entity generator doesn't support reactive apps with databases of type sql at the moment
Error: The entity generator doesn't support reactive apps with databases of type sql at the moment
at EntityGenerator.error (C:\Users\metin.bulak\Desktop\jh\node_modules\generator-jhipster\generators\generator-base.js:1590:15)
at EntityGenerator.validateReactiveCompatibility (C:\Users\metin.bulak\Desktop\jh\node_modules\generator-jhipster\generators\entity\index.js:240:26)
at Object.<anonymous> (C:\Users\metin.bulak\Desktop\jh\node_modules\yeoman-generator\lib\index.js:893:25)
at C:\Users\metin.bulak\Desktop\jh\node_modules\run-async\index.js:49:25
at new Promise (<anonymous>)
at C:\Users\metin.bulak\Desktop\jh\node_modules\run-async\index.js:26:19
at runLoop.add.once.once (C:\Users\metin.bulak\Desktop\jh\node_modules\yeoman-generator\lib\index.js:894:11)
at processImmediate (internal/timers.js:456:21)
You've chosen to generate a reactive app with Spring WebFlux and so you can't use SQL databases because JDBC is blocking and R2DBC is not yet supported by JHipster.
So you have 2 choices: generate a non reactive app and use SQL database or generate a reactive app and use a noSQL database (MongoDB, Cassandra, Couchbase).

crypto.getCurves is undefined

I am trying to use an oauth helper library called 'openid-client'. I am getting an error that reads in part '(TypeError): getCurves is not a function'. I poke around and find that getCurves is part of an inbuilt module of node.js 'crypto'.
If I console.log(typeOf(crypto.getCurves)) I get undefined. If I console.log(crypto) I see that crypto has many available methods but getCurves is not among them.
I am running node on my macbook and my project is a barebones npx create-react-app app with openid-client installed.
The node documentation outlines a way for determining if crypto support is unavailable, but that does not seem to indicate that crypto is unavailable for me.
I'm not sure why my version of node crypto does not have getCurves. Is there a way to install the correct version? Is there some sort of encryption restriction I am hitting due to OS? Any help appreciated.
node-openid-client is using APIs which are provided by Node and are missing in browser.
Node is being used by CRA as a development tool. App itself is running in browser and can't access Node's API-s, so it doesn't matter which Node version CRA is using.
When built, app is a set of JS files which can be served by a webserver (such as Nginx) directly without using Node at all.
So, this library can't be used with CRA apps.
https://github.com/panva/node-openid-client/issues/218
As you said, crypto is a built-in module, which means that its functionality depends on the version of node.js you have installed (you can check it via node -v from the shell or via console.log(process.version) at runtime).
Node.js API docs say that getCurves() was added in v2.3.0, so make sure your node is more recent than that.

JHipster Mini Book Tuto fail, like other

Trying to setup an app with JHipster. Every tutorials I follow I have errors and failures.
Whatever options I select I got errors on my project.
Following the JHipster MiniBook procedure I have error like this on my IDE at start:
http://imgur.com/bWdek5W
And when I follow the directives to page 24 and try to run
./gradlew bootRun
I got a build failed: http://imgur.com/jFeJEQ6
I don't know what I'm doing wrong. I follow step by step the book, or other tutorials. Something must be wrong configured on my computer.
Any idea ?
Just looking at the error messages which are shown:
On the first screenshot you have configured your IDE to use Java 1.6 source code. JHipster is using Java 1.8, so the lambda expressions (which are new in Java 1.8) cannot be compiled.
On the second screenshot you have configured JHipster to use an external database. But you have not followed the documentation, which tells you to configure that external database in your application-dev.yml configuration file (and to start the database, of course!)

Resources