创建后无法立即运行JHipster项目

时间:2015-02-11 18:05:01

标签: jhipster

我无法在生成项目后立即运行jhipster生成的项目。

~/folder$ yo jhipster

完成“向导”,然后

~/folder$ gradle bootRun

轰!它在“npmInstall”步骤中失败。 “bower install”和“npm install”自行工作正常。

例外(运行“gradle --stacktrace bootRun”时)

 Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'npm''
at org.gradle.process.internal.DefaultExecHandle.setEndStateInfo(DefaultExecHandle.java:196)
at org.gradle.process.internal.DefaultExecHandle.failed(DefaultExecHandle.java:325)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:83)
... 1 more
Caused by: net.rubygrapefruit.platform.NativeException: Could not start 'npm'
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:65)
... 1 more
Caused by: java.io.IOException: Cannot run program "npm" (in directory "/<...>/workspace/netreon"): error=2, No such file or directory
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
... 3 more
Caused by: java.io.IOException: error=2, No such file or directory
... 4 more

虽然可以在PATH上使用Npm,但是使用brew

安装
$ which node
/usr/local/bin/node                                                                                                                                     
$ which npm
/usr/local/bin/npm
$ node --version
v0.10.29
$ npm --version
2.5.0
$ java -version
java version "1.7.0_55"
$ javac -version
javac 1.7.0_55

.yo-rc.json configs:

{
  "generator-jhipster": {
    "baseName": "myproj",
    "packageName": "com.myproj",
    "packageFolder": "com/myproj",
    "authenticationType": "oauth2",
    "hibernateCache": "ehcache",
    "clusteredHttpSession": "no",
    "websocket": "spring-websocket",
    "databaseType": "sql",
    "devDatabaseType": "mysql",
    "prodDatabaseType": "mysql",
    "useCompass": true,
    "buildTool": "gradle",
    "frontendBuilder": "gulp",
    "javaVersion": "7"
  }
}

我认为我有最新版本的jhipster生成器,不知道如何检查

1 个答案:

答案 0 :(得分:0)

您是否使用sudo -i以root身份运行? npm很少为root安装,这就是我的问题。

只需gradlew在您的普通用户下