Jhipster 2.27:无法创建实体

Jhipster 2.27 : can't create an entity

我分叉了 Jhipster 2.27 并尝试添加一个实体 哟jhipster:entity车

我收到这个错误:

events.js:154  
      throw er; // Unhandled 'error' event  
      ^  


TypeError: Cannot read property 'endsWith' of undefined  
    at Generator.getAngularAppName   (/home/myUbuntu/dev/workspace/generator-jhipster-master/generators/generator-base.js:1223:67)  
    at module.exports.EntityGenerator.extend.initializing.getConfig (/home/myUbuntu/dev/workspace/generator-jhipster-master/generators/entity/index.js:116:40)  
    at Object.<anonymous> (/home/myUbuntu/dev/workspace/generator-jhipster-master/node_modules/yeoman-generator/lib/base.js:436:25)  
    at /home/myUbuntu/dev/workspace/generator-jhipster-master/node_modules/yeoman-generator/node_modules/run-async/index.js:24:25  
    at /home/myUbuntu/dev/workspace/generator-jhipster-master/node_modules/yeoman-generator/lib/base.js:448:8  
    at processImmediate [as _immediateCallback] (timers.js:383:17)

.yo-rc.json 文件:

  GNU nano 2.4.2                                                      Fichier : .yo-rc.json                                                                                                                 

{
  "generator-jhipster": {
    "jhipsterVersion": "2.27.0",
    "baseName": "jhipster",
    "packageName": "com.myApp.testapp",
    "packageFolder": "com/myApp/testapp",
    "authenticationType": "session",
    "hibernateCache": "ehcache",
    "clusteredHttpSession": "no",
    "websocket": "no",
    "databaseType": "sql",
    "devDatabaseType": "mysql",
    "prodDatabaseType": "mysql",
    "searchEngine": "no",
    "buildTool": "maven",
    "enableSocialSignIn": false,
    "rememberMeKey": "c959bf1efd5c74e68c9700e2ad012ff595ed52ec",
    "useSass": false,
    "languages": [
      "fr",
      "ca"
    ]
  },
  "testapp": {
    "jhipsterVersion": "2.27.0",
    "applicationType": "monolith",
    "baseName": "jhipster",
    "testFrameworks": [
      "gatling"
    ],
    "enableTranslation": true,
    "nativeLanguage": "fr",
    "languages": [
      "fr",
      "ca"
    ]
  }
}

知道这里出了什么问题吗?

谢谢。

[更新] 这就是我所做的:

Welcome to the JHipster Generator v2.27.0
Application files will be generated in folder: /home/myUbuntu/dev/workspace/generator-jhipster-master
? (1/15) Which *type* of application would you like to create? Monolithic application (recommended for simple projects)
? (2/15) What is the base name of your application? jhipster
? (3/15) What is your default Java package name? com.myapp.testapp
? (4/15) Which *type* of authentication would you like to use? HTTP Session Authentication (stateful, default Spring Security mechanism)
? (5/15) Which *type* of database would you like to use? SQL (H2, MySQL, PostgreSQL, Oracle)
? (6/15) Which *production* database would you like to use? MySQL
? (7/15) Which *development* database would you like to use? MySQL
? (8/15) Do you want to use Hibernate 2nd level cache? Yes, with ehcache (local cache, for a single node)
? (9/15) Do you want to use a search engine in your application? No
? (10/15) Do you want to use clustered HTTP sessions? No
? (11/15) Do you want to use WebSockets? No
? (12/15) Would you like to use Maven or Gradle for building the backend? Maven
? (13/15) Would you like to use the LibSass stylesheet preprocessor for your CSS? No
? (14/15) Would you like to enable internationalization support? Yes
? Please choose the native language of the application? French
? Please choose additional languages to install Catalan
? (15/15) Which testing frameworks would you like to use? Gatling

Installing languages: fr, ca
   create bower.json
 conflict package.json
? Overwrite package.json? overwrite
    force package.json
 conflict README.md
? Overwrite README.md? overwrite
    force README.md
 conflict .gitignore
? Overwrite .gitignore? overwrite
    force .gitignore
 conflict .gitattributes
? Overwrite .gitattributes? overwrite
    force .gitattributes
 conflict .editorconfig
? Overwrite .editorconfig? overwrite
    force .editorconfig
 conflict .travis.yml
? Overwrite .travis.yml? overwrite

然后 :

yo jhipster:entity car

.yo-rc.json 文件: GNU nano 2.4.2 文件:.yo-rc.json

{
  "generator-jhipster": {
    "jhipsterVersion": "2.27.0",
    "baseName": "jhipster",
    "packageName": "com.myapp.testapp",
    "packageFolder": "com/myapp/testapp",
    "authenticationType": "session",
    "hibernateCache": "ehcache",
    "clusteredHttpSession": "no",
    "websocket": "no",
    "databaseType": "sql",
    "devDatabaseType": "mysql",
    "prodDatabaseType": "mysql",
    "searchEngine": "no",
    "buildTool": "maven",
    "enableSocialSignIn": false,
    "rememberMeKey": "6b7f2e0be835e1ec6541cf6607c28d97edca19cc",
    "useSass": false,
    "applicationType": "monolith",
    "testFrameworks": [
      "gatling"
    ],
    "enableTranslation": true,
    "nativeLanguage": "fr",
    "languages": [
      "fr",
      "ca"
    ]
  }
}

更新2

npm ERR! Linux 4.2.0-16-generic npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" npm ERR! node v5.6.0 npm ERR! npm v3.6.0

npm ERR! No compatible version found: generator-jhipster@0.0.0 npm ERR! Valid install targets: npm ERR! 2.27.2, 2.27.1, 2.27.0, 2.26.2, 2.26.1, 2.26.0, 2.25.0, 2.24.0, 2.23.1, 2.23.0, 2.22.0, 2.21.1, 2.21.0, 2.20.0, 2.19.0, 2.18.0, 2.17.0, 2.16.1, 2.16.0, 2.15.2, 2.15.1, 2.15.0, 2.14.2, 2.14.1, 2.14.0, 2.13.1, 2.13.0, 2.12.0, 2.11.1, 2.11.0, 2.10.1, 2.10.0, 2.9.2, 2.9.1, 2.9.0, 2.8.0, 2.7.0, 2.6.0, 2.5.2, 2.5.1, 2.5.0, 2.4.0, 2.3.0, 2.2.0, 2.1.1, 2.1.0, 2.0.0, 1.10.2, 1.10.1, 1.10.0, 1.9.0, 1.8.1, 1.8.0, 1.7.1, 1.7.0, 1.6.0, 1.5.0, 1.4.0, 1.3.0, 1.2.2, 1.2.1, 1.2.0, 1.1.1, 1.1.0, 1.0.0, 0.18.1, 0.18.0, 0.17.2, 0.17.1, 0.17.0, 0.16.0, 0.15.0, 0.14.0, 0.13.0, 0.12.0, 0.11.0, 0.10.1, 0.10.0, 0.9.3, 0.9.2, 0.9.1, 0.9.0, 0.8.4, 0.8.3, 0.8.2, 0.8.1, 0.8.0, 0.7.1, 0.7.0, 0.6.2, 0.6.1, 0.6.0, 0.5.2, 0.5.1, 0.5.0, 0.4.0, 0.3.1, 0.3.0, 0.2.1, 0.2.0, 0.1.0, 0.0.29, 0.0.28, 0.0.27, 0.0.26, 0.0.23, 0.0.22, 0.0.21, 0.0.20, 0.0.19, 0.0.18, 0.0.17, 0.0.16, 0.0.15, 0.0.14, 0.0.13, 0.0.12, 0.0.11, 0.0.10, 0.0.9, 0.0.8, 0.0.7, 0.0.6, 0.0.5, 0.0.4, 0.0.3, 0.0.2, 0.0.1 npm ERR! npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request: npm ERR! /home/myUbuntu/dev/workspace/rhapp/npm-debug.log module.js:341 throw err; ^

Error: Cannot find module 'gulp-autoprefixer'

  1. 你还没有 fork JHipster 2.27,你已经 fork JHipster 3.0 来自 master(2.27 在 v2.x_maintenance 分支上)否则你会 没有建议生成单体应用程序。
  2. 您似乎手动修改了 .yo-rc.json 文件,因为 JHipster 会拒绝 com.myApp.testapp 并出现以下错误:"The package name you have provided is not a valid Java package name."
  3. 你的 .yo-rc.json 文件无效,不应该有这个 "testapp" 部分,这就是它失败的原因。

您的 .yo-rc.json 文件应该是这样的:

{
  "generator-jhipster": {
    "jhipsterVersion": "2.27.0",
    "baseName": "jhipster",
    "packageName": "com.myapp.testapp",
    "packageFolder": "com/myapp/testapp",
    "authenticationType": "session",
    "hibernateCache": "ehcache",
    "clusteredHttpSession": "no",
    "websocket": "no",
    "databaseType": "sql",
    "devDatabaseType": "mysql",
    "prodDatabaseType": "mysql",
    "searchEngine": "no",
    "buildTool": "maven",
    "enableSocialSignIn": false,
    "rememberMeKey": "33cd878a5fc34f050fec62a1c0c3f4dafb64458e",
    "useSass": false,
    "applicationType": "monolith",
    "testFrameworks": [
      "gatling"
    ],
    "enableTranslation": true,
    "nativeLanguage": "fr",
    "languages": [
      "fr",
      "ca"
    ]
  }
}

更新 1

从您的跟踪看来,您似乎试图在生成器的文件夹中生成一个应用程序,但这是行不通的。

Application files will be generated in folder: /home/myUbuntu/dev/workspace/generator-jhipster-master

您必须 运行 yo jhipster 在一个新的空文件夹中。

更新 2

您的上一个错误看起来像是您更改了 package.json 中的生成器版本。然后 Npm 在 nmpjs.org 上查找此版本,但找不到它。

更新 3

阅读我们关于如何使用分叉生成器的文档:https://github.com/jhipster/generator-jhipster/blob/master/CONTRIBUTING.md#setup