generator-jhipster-primeng: angular2AppName is not defined
Hi,
I juste move to Jhipster 5.1 and a weird issue.
On a fresh Jhipster install, i install jhipster-prime and get the text below
TL;DR
angular2AppName is not defined
How can I get rid of this ?
PS : on a fresh jhipster installation i made
npm install -g generator-jhipster-primeng
npm update -g generator-jhipster-primeng
But when i try
yo jhipster-primeng
I got the error.
Any help would be appreciate
Details
C:\Users\giova\Work\Projects\demo-prime-ng>yo jhipster-primeng
██████╗ ██████╗ ██╗ ███╗ ███╗ ███████╗ ███╗ ██╗ ██████╗
██╔══██╗ ██╔══██╗ ██║ ████╗ ████║ ██╔════╝ ████╗ ██║ ██╔════╝
██████╔╝ ██████╔╝ ██║ ██╔████╔██║ █████╗ ██╔██╗ ██║ ██║ ███╗
██╔═══╝ ██╔══██╗ ██║ ██║╚██╔╝██║ ██╔══╝ ██║╚██╗██║ ██║ ██║
██║ ██║ ██║ ██║ ██║ ╚═╝ ██║ ███████╗ ██║ ╚████║ ╚██████╔╝
╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚═╝ ╚═══╝ ╚═════╝
Welcome to the JHipster primeng generator! v2.0.55
? Do you want to install PrimeNG? Yes
? Which theme would you like to use? Rocket
? What is your preferred component selection criteria Component Groups
? Which component groups you would like to use? inputs, buttons, data, panel, overlay, fileupload, menu, charts, messages, multimedia, dragdrop, misc
Add the resources in the head section of index.html file- <script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.1.0/fullcalendar.min.css"/>
<script src="https://www.google.com/recaptcha/api.js?render=explicit&onload=initRecaptcha" async defer></script>
<script src="https://cdn.quilljs.com/1.0.0/quill.js"></script>
<script type="text/javascript" src="https://maps.google.com/maps/api/js?key=AIzaSyA6Ar0UymhiklJBzEPLKKn2QHwbjdz3XV0" ></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.1.0/fullcalendar.min.js"></script>
The PrimeNG resources were updated successfully using JHipster API!
events.js:183
throw er; // Unhandled 'error' event
^
ReferenceError: C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\generators\app\templates\src\main\webapp\app\primeng\primeng.module.ts:4
2| import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
3|
>> 4| import { <%= angular2AppName %>ButtonDemoModule } from './buttons/button/buttondemo.module';
5| import { <%= angular2AppName %>SplitbuttonDemoModule } from './buttons/splitbutton/splitbuttondemo.module';
6|
7| import { <%= angular2AppName %>DialogDemoModule } from './overlay/dialog/dialogdemo.module';
angular2AppName is not defined
at eval (eval at compile (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\ejs\lib\ejs.js:618:12), <anonymous>:11:26)
at returnedFn (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\ejs\lib\ejs.js:653:17)
at Object.exports.render (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\ejs\lib\ejs.js:416:37)
at process (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\yeoman-generator\node_modules\mem-fs-editor\lib\actions\copy-tpl.js:12:18)
at applyProcessingFunc (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\yeoman-generator\node_modules\mem-fs-editor\lib\actions\copy.js:13:16)
at EditionInterface.exports._copySingle (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\yeoman-generator\node_modules\mem-fs-editor\lib\actions\copy.js:63:16)
at files.forEach.file (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\yeoman-generator\node_modules\mem-fs-editor\lib\actions\copy.js:50:10)
at Array.forEach (<anonymous>)
at EditionInterface.exports.copy (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\yeoman-generator\node_modules\mem-fs-editor\lib\actions\copy.js:49:9)
at EditionInterface.module.exports [as copyTpl] (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\yeoman-generator\node_modules\mem-fs-editor\lib\actions\copy-tpl.js:10:8)
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (5 by maintainers)
I am newbie in both angular and jhipster so I am not sure about these steps, but the below steps solved many of my issues
In generator-jhipster-primeng\generators\app\index.js Below line this.angularAppName = this.getAngularAppName(); added this.angular2AppName = this.getAngularXAppName();
In the *.route.ts files under generator-jhipster-primeng\generators\app\templates\src\main\webapp\app\primeng the path to the UserRouteAccessService was wrong. To correct this I searched and replaced the import statements as below
import { UserRouteAccessService } from ‘…/…/…/shared/shared’; with import { UserRouteAccessService } from ‘…/…/…/core/auth/user-route-access-service’;
In templates for services the below lines was causing an error .map((response) =>
This was replaced with .map(response =>
Hi,
I’ve apply the fix you suggest.
In node_modules\generator-jhipster-primeng\generators\app\index.js, i add this line :
this.angular2AppName = this.getAngularAppName()Installation successfull! But then, i tried to start the application with yarn start and got a LOT of errors.
Please, could you provide any help fixing this ?
Thanks
(this is just an extract of ERRORS and WARNING)