java - 我无法安装generator-jhipster-uml来生成实体

标签 java jhipster

我正在尝试从 https://jhipster.github.io/jdl-studio/ 生成实体(Java 类) ,我创建 jhipster-jdl.jh 文件并开始生成实体。首先根据文档我使用这个

yo jhipster:import-jdl my_file.jdl

生成我的实体,但此语句生成一些 .json 文件,仅此而已,但我需要 java 类、DTO、服务和其他文件。我的 friend 告诉我用这个:

yo jhipster-uml my_file.jdl

但之后我收到此错误:

Error jhipster-uml .\jhipster-jdl.jh

You don’t seem to have a generator with the name “jhipster-uml” installed.
But help is on the way:

You can see available generators via npm search yeoman-generator or via http://yeoman.io/gene
Install them with npm install generator-jhipster-uml.

To see all your installed generators run yo without any arguments. 

然后我尝试安装这个生成器,但出现其他错误:

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\M\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\
npm-cli.js" "install" "generator-jhipster-uml"
npm ERR! node v6.9.4
npm ERR! npm  v4.1.2
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/generator-jhipster-uml
npm ERR! 404
npm ERR! 404  'generator-jhipster-uml' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

我该怎么办?我做了文档中描述的所有事情。我使用的是 Jhipster 版本 3 而不是 4。我应该迁移更高版本来解决这个问题吗?

最佳答案

yo jhipster:import-jdl my_file.jdl 应该导入您的 JDL 并为实体生成 JSON 文件和前端/后端文件。如果失败,请提出问题。

jhipster-uml 不是 yeoman-generator,因此运行它时前面不带 yo。这也是安装 generator-jhipster-uml 失败的原因。要安装,follow the instructions in the docs :

 npm install -g jhipster-uml

如果您还没有开始项目,我建议升级到 v4。如果需要,您现在仍然可以使用 Angular 1。

关于java - 我无法安装generator-jhipster-uml来生成实体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42014951/

相关文章:

angularjs - 如何在 JHipster 应用程序中显示特定角色的 View 或数据

java - 异常层次结构/try-multi-catch

java - Tomcat 从 URL 中删除上下文路径

javascript - 从 html 到 ts 的值

linux - 在 Linux 上使用 Angular4 构建 JHipster 时出现问题

elasticsearch - Elasticsearch与Cassandra集成

java - 我在从标准输入和/或命令行读取时遇到问题

java - 用 Java 制作 3D 迷宫

java - CompletableFuture 的 obtrudeValue() 方法如何工作?

java - 如何从 jhipster 的表中删除选中的行