【问题标题】:I can not install generator-jhipster-uml to generate entities我无法安装 generator-jhipster-uml 来生成实体
【发布时间】:2017-06-20 06:37:38
【问题描述】:

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

yo jhipster:import-jdl my_file.jdl

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

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。我应该迁移更高版本来解决这个问题吗?

【问题讨论】:

    标签: java jhipster


    【解决方案1】:

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

    jhipster-uml 不是 yeoman 生成器,因此您可以在没有 yo 之前运行它。这也是安装generator-jhipster-uml 失败的原因。要安装,follow the instructions in the docs:

     npm install -g jhipster-uml
    

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

    【讨论】:

      猜你喜欢
      • 2017-07-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-06
      • 1970-01-01
      • 1970-01-01
      • 2023-03-04
      • 2021-02-07
      相关资源
      最近更新 更多