我对 JHipster 有疑问。我无法在刚从头开始创建的项目中导入任何 JDL 文件。甚至来自 JHipster 的 jdl-samples 也不起作用。我总是遇到同样的错误:
events.js:182
throw er; // Unhandled 'error' event
^
Error: ERROR!
Error while parsing entities from JDL
at Environment.error (/project/node_modules/yeoman-environment/lib/environment.js:140:40)
at constructor.error (/project/node_modules/generator-jhipster/generators/generator-base.js:1686:18)
at constructor.parseJDL (/project/node_modules/generator-jhipster/generators/import-jdl/index.js:108:22)
at Object.<anonymous> (/project/node_modules/yeoman-generator/lib/index.js:417:23)
at /project/node_modules/run-async/index.js:25:25
at Promise (<anonymous>)
at /project/node_modules/run-async/index.js:24:19
at /project/node_modules/yeoman-generator/lib/index.js:418:9
at runCallback (timers.js:781:20)
at tryOnImmediate (timers.js:743:5)
使用 --debug 选项: 命令:
yo jhipster:import-jdl ~/Downloads/example.jh
输出:
The jdl is being parsed.
DEBUG! Error:
{ name: 'NoSQLModelingException',
message: 'NoSQL entities don\'t have relationships.',
prototype: Error
at new BuildException (/Users/jega/projects/owcHandwerker/plattformapp/node_modules/jhipster-core/lib/exceptions/exception_factory.js:42:25)
at checkNoSQLModeling (/Users/jega/projects/owcHandwerker/plattformapp/node_modules/jhipster-core/lib/parser/entity_parser.js:70:11)
at Object.parse [as convertToJHipsterJSON] (/Users/jega/projects/owcHandwerker/plattformapp/node_modules/jhipster-core/lib/parser/entity_parser.js:40:5)
at constructor.parseJDL (/Users/jega/projects/owcHandwerker/plattformapp/node_modules/generator-jhipster/generators/import-jdl/index.js:93:42)
at Object.<anonymous> (/Users/jega/projects/owcHandwerker/plattformapp/node_modules/yeoman-generator/lib/index.js:417:23)
at /Users/jega/projects/owcHandwerker/plattformapp/node_modules/run-async/index.js:25:25
at Promise (<anonymous>)
at /Users/jega/projects/owcHandwerker/plattformapp/node_modules/run-async/index.js:24:19
at /Users/jega/projects/owcHandwerker/plattformapp/node_modules/yeoman-generator/lib/index.js:418:9
at runCallback (timers.js:781:20) }
Error jhipster:import-jdl /Users/jega/Downloads/example.jh --debug
Error: ERROR!
Error while parsing entities from JDL
at Environment.error (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:157:40)
at constructor.error (/Users/jega/projects/owcHandwerker/plattformapp/node_modules/generator-jhipster/generators/generator-base.js:1686:18)
at constructor.parseJDL (/Users/jega/projects/owcHandwerker/plattformapp/node_modules/generator-jhipster/generators/import-jdl/index.js:108:22)
at Object.<anonymous> (/Users/jega/projects/owcHandwerker/plattformapp/node_modules/yeoman-generator/lib/index.js:417:23)
at /Users/jega/projects/owcHandwerker/plattformapp/node_modules/run-async/index.js:25:25
at Promise (<anonymous>)
at /Users/jega/projects/owcHandwerker/plattformapp/node_modules/run-async/index.js:24:19
at /Users/jega/projects/owcHandwerker/plattformapp/node_modules/yeoman-generator/lib/index.js:418:9
at runCallback (timers.js:781:20)
at tryOnImmediate (timers.js:743:5)
我尝试的 JDL 文件来自此处的 JHipster 博客示例: https ://github.com/jhipster/jdl-samples/blob/master/blog.jh