2013-06-11 11 views
5

私はmaven webappでyeoman-maven-pluginを試しています。私が "clean install -DskipTests = true -X"を実行すると、次の出力が得られます。私のプロジェクトのルート内に "yo"ディレクトリが存在するため、何が起こっているのか分かりません。そのディレクトリ内で "yo angular - minsafe"を実行してアプリケーションを初期化しました。yeoman-maven-pluginを使用すると、npmでエラーが発生してビルドを実行できません。

[ERROR] Failed to execute goal com.github.trecloux:yeoman-maven-plugin:0.1:build (default) on project map-trucks: Error during : npm install: Cannot run program "npm" (in directory "/Users/patrick/IdeaProjects/XTL/map-trucks/yo"): error=2, No such file or directory -> [Help 1] 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.trecloux:yeoman-maven-plugin:0.1:build (default) on project map-trucks: Error during : npm install 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) 
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) 
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) 
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) 
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) 
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319) 
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) 
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) 
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) 
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
    at java.lang.reflect.Method.invoke(Method.java:597) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) 
    at org.codehaus.classworlds.Launcher.main(Launcher.java:47) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
    at java.lang.reflect.Method.invoke(Method.java:597) 
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) 
Caused by: org.apache.maven.plugin.MojoExecutionException: Error during : npm install 
    at com.axonactive.yeoman.YeomanMojo.executeCommand(YeomanMojo.java:68) 
    at com.axonactive.yeoman.YeomanMojo.npmInstall(YeomanMojo.java:44) 
    at com.axonactive.yeoman.YeomanMojo.execute(YeomanMojo.java:38) 
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) 
    ... 25 more 
Caused by: java.io.IOException: Cannot run program "npm" (in directory "/Users/patrick/IdeaProjects/XTL/map-trucks/yo"): error=2, No such file or directory 
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:470) 
    at java.lang.Runtime.exec(Runtime.java:593) 
    at org.apache.commons.exec.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:58) 
    at org.apache.commons.exec.DefaultExecutor.launch(DefaultExecutor.java:254) 
    at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:319) 
    at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:160) 
    at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:147) 
    at com.axonactive.yeoman.YeomanMojo.executeCommand(YeomanMojo.java:66) 
    ... 29 more 
Caused by: java.io.IOException: error=2, No such file or directory 
    at java.lang.UNIXProcess.forkAndExec(Native Method) 
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:53) 
    at java.lang.ProcessImpl.start(ProcessImpl.java:91) 
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:452) 
    ... 36 more 
+0

ですから、解決策パトリックを見つけました、私はそれがコンソールから[OK]を作品に決定しましたが、IntelliJの... –

+0

内で実行する場合には、失敗していますか? –

答えて

7

yeoman-maven-pluginにご関心をお寄せいただきありがとうございます。

私は問題は、npmがIntelliJのようなGUIアプリケーションのPATHにないことだと思います。 解決策は、/ etc/launchd.confファイルを作成して編集し、npmパスを追加することです(npmにbrewをインストールした後、npmパスと/ usr/local/share/npmに/ usr/local/binを追加しました)パッケージ/ binに(よ、イサキ、...)

setenv PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/share/npm/bin

+0

ありがとう、トーマス。私はそれを試してみましょう:) –

関連する問題