hermeslm / generator-jhipster-angular-datatables

JHipster module to change default data grid(table) with Angular DataTables
Other
13 stars 10 forks source link

Error using the generator with jhipster 4.3.0 #5

Closed ernesto-butto closed 7 years ago

ernesto-butto commented 7 years ago

Hello!

I tried using this generator to update a new jhipster app i'm buidling, with the latest 4.3.0 jhipster version. However, I got all this errors, and the view of my entity is still the same. Afterwards I ran yarn install since we don't use gulp or bower on this Angular 4 app. Thank you in advance for working on this and for your help

yo jhipster-angular-datatables
Composing JHipster configuration with module angular-datatables
Welcome to the JHipster-Angular-DataTables Generator! v1.3.10

This will change JHipster Entity list component with Angular-DataTables

Reading the JHipster project configuration for your module
? (1/2) Do you want to use template based or the default views? Yes, use templates based
? (2/2) Do you want to change all existing entities, all your custom code will be overwritten? No, let me choose the entities to update
? Please choose the entities to be updated Request
TypeError: Cannot read property 'dependencies' of undefined
    at jhipsterUtils.rewriteJSONFile (/Users/poolebu/Desktop/ErnestoLab/nhgSalesPortal/node_modules/generator-jhipster/generators/generator-base.js:426:24)
    at Object.rewriteJSONFile (/Users/poolebu/Desktop/ErnestoLab/nhgSalesPortal/node_modules/generator-jhipster/generators/util.js:88:5)
    at Object.addBowerDependency (/Users/poolebu/Desktop/ErnestoLab/nhgSalesPortal/node_modules/generator-jhipster/generators/generator-base.js:425:27)
    at child.writeBaseFiles (/Users/poolebu/.npm-packages/lib/node_modules/generator-jhipster-angular-datatables/generators/app/index.js:166:20)
    at Object.<anonymous> (/Users/poolebu/.npm-packages/lib/node_modules/generator-jhipster-angular-datatables/node_modules/yeoman-generator/lib/base.js:436:25)
    at /Users/poolebu/.npm-packages/lib/node_modules/generator-jhipster-angular-datatables/node_modules/yeoman-generator/node_modules/run-async/index.js:25:25
    at /Users/poolebu/.npm-packages/lib/node_modules/generator-jhipster-angular-datatables/node_modules/yeoman-generator/node_modules/run-async/index.js:24:19
    at /Users/poolebu/.npm-packages/lib/node_modules/generator-jhipster-angular-datatables/node_modules/yeoman-generator/lib/base.js:452:8
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)

Unable to find bower.json. Reference to bower dependency (name: angular-datatables, version:0.5.5) not added.

TypeError: Cannot read property 'dependencies' of undefined
    at jhipsterUtils.rewriteJSONFile (/Users/poolebu/Desktop/ErnestoLab/nhgSalesPortal/node_modules/generator-jhipster/generators/generator-base.js:426:24)
    at Object.rewriteJSONFile (/Users/poolebu/Desktop/ErnestoLab/nhgSalesPortal/node_modules/generator-jhipster/generators/util.js:88:5)
    at Object.addBowerDependency (/Users/poolebu/Desktop/ErnestoLab/nhgSalesPortal/node_modules/generator-jhipster/generators/generator-base.js:425:27)
    at child.writeBaseFiles (/Users/poolebu/.npm-packages/lib/node_modules/generator-jhipster-angular-datatables/generators/app/index.js:167:20)
    at Object.<anonymous> (/Users/poolebu/.npm-packages/lib/node_modules/generator-jhipster-angular-datatables/node_modules/yeoman-generator/lib/base.js:436:25)
    at /Users/poolebu/.npm-packages/lib/node_modules/generator-jhipster-angular-datatables/node_modules/yeoman-generator/node_modules/run-async/index.js:25:25
    at /Users/poolebu/.npm-packages/lib/node_modules/generator-jhipster-angular-datatables/node_modules/yeoman-generator/node_modules/run-async/index.js:24:19
    at /Users/poolebu/.npm-packages/lib/node_modules/generator-jhipster-angular-datatables/node_modules/yeoman-generator/lib/base.js:452:8
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)

Unable to find bower.json. Reference to bower dependency (name: ods-lib, version:https://github.com/hermeslm/ods-lib.git#1.1.7) not added.

Unable to find src/main/webapp/app/app.module.js or missing required jhipster-needle. Reference to datatables not added to JHipster app.

Unable to find src/main/webapp/app/app.module.js or missing required jhipster-needle. Reference to datatables.factory not added to JHipster app.

Unable to find src/main/webapp/app/app.module.js or missing required jhipster-needle. Reference to datatables.bootstrap not added to JHipster app.

Unable to find src/main/webapp/app/app.module.js or missing required jhipster-needle. Reference to datatables.colreorder not added to JHipster app.

Unable to find src/main/webapp/app/app.module.js or missing required jhipster-needle. Reference to datatables.columnfilter not added to JHipster app.

Unable to find src/main/webapp/app/app.module.js or missing required jhipster-needle. Reference to ods-lib not added to JHipster app.

I'm Updating selected entities Request
WARN! dto is missing in .jhipster/Request.json, using no as fallback

   create src/main/webapp/app/entities/tpl/list-box-header-tpl.html
   create src/main/webapp/app/entities/tpl/list-header-tpl.html
   create src/main/webapp/app/entities/request/requests.html
   create src/main/webapp/app/entities/request/request.controller.js
   create .jhipster/modules/jhi-hooks.json

I'm all done. Running bower install for you to install the required dependencies. If this fails, try running the command yourself.

module.js:472
    throw err;
    ^

Error: Cannot find module 'internal/fs'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at evalmachine.<anonymous>:18:20
    at Object.<anonymous> (/Users/poolebu/.npm-packages/lib/node_modules/bower/node_modules/graceful-fs/fs.js:11:1)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)

Angular Datatables are enabled for entities, you will have an option to enable audit while creating new entities as well

I'm running gulp install now
[20:10:42] Local gulp not found in ~/Desktop/ErnestoLab/nhgSalesPortal
[20:10:42] Try running: npm install gulp
hermeslm commented 7 years ago

This error occurred is issue because bower.json does not exist in the project root folder, then when generator try to add the library "ods-lib, version:https://github.com/hermeslm/ods-lib.git#1.1.7", the same behavior occurred when the generator add "ods-lib" dependency in "src/main/webapp/app/app.module.js". This generator only work with angular v1.x, I think you have a jhipster project with angular version 2 or 4, check that. I ran the generator with jhipster v4.3.0 and angular v1.x and everything worked well. When I did this generator the Angular v2 in jhipster was not added, so I go to add a note that Angular Datatables generator works for any jhipster version but with Angular v1. Sorry about that, comming soon I will add support for Angular v2 or v4.

ernesto-butto commented 7 years ago

Yes, you are right, I wrongly assumed that because you supported jhipster 4+ it meant that it supported angular 4 or at least 2. Looking forward to the Angular support, thank you for the reply