在gradle

时间:2016-08-04 18:32:04

标签: grails gradle npm build.gradle grails-3.1

我对gradle和npm都很陌生,我试图让grails3 - angularjs2示例应用程序启动并运行。

这是应用程序 https://github.com/agileorbit/grails3-angular2-starter

当我尝试运行应用程序时,我得到以下异常,这似乎发生在这里

task startTscWatch(type: SpawnProcessTask, dependsOn: [copyNodeModules, cleanUpPid]) {
    command "npm run watch"
    ready 'Compilation complete. Watching for file changes.'
}

我不完全理解异常,所以如果有人可以帮我指出正确的方向,我们将不胜感激。

  

建筑失败
                 总时间:7.063秒|错误无法启动服务器(注意:堆栈跟踪已被过滤。使用--verbose查看整个   trace。)org.gradle.tooling.BuildException:无法执行构建   使用Gradle分布   ' https://services.gradle.org/distributions/gradle-2.9-bin.zip&#39 ;.           在org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:57)           在org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor $ 1 $ 1.run(DefaultAsyncConsumerActionExecutor.java:57)           at org.gradle.internal.concurrent.DefaultExecutorFactory $ StoppableExecutorImpl $ 1.run(DefaultExecutorFactory.java:64)           在org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)           在org.gradle.tooling.internal.consumer.DefaultBuildLauncher.run(DefaultBuildLauncher.java:71)           在org.grails.cli.gradle.GradleUtil $ _runBuildWithConsoleOutput_closure4.doCall(GradleUtil.groovy:107)           在org.grails.cli.gradle.GradleUtil $ _withProjectConnection_closure2.doCall(GradleUtil.groovy:87)           在org.grails.cli.gradle.GradleUtil $ _withProjectConnection_closure2.call(GradleUtil.groovy)           at grails.io.support.SystemOutErrCapturer.withNullOutput(SystemOutErrCapturer.groovy:64)           在org.grails.cli.gradle.GradleUtil.withProjectConnection(GradleUtil.groovy:86)           在org.grails.cli.gradle.GradleUtil.runBuildWithConsoleOutput(GradleUtil.groovy:102)           在org.grails.cli.gradle.GradleInvoker.invokeMethod(GradleInvoker.groovy:50)           在run-app.run(run-app.groovy:48)           在org.grails.cli.profile.commands.script.GroovyScriptCommand.handle(GroovyScriptCommand.groovy:146)           在org.grails.cli.profile.DefaultProfile.handleCommand(DefaultProfile.groovy:177)           在org.grails.cli.GrailsCli.handleCommand(GrailsCli.groovy:235)           在org.grails.cli.GrailsCli $ _handleCommandWithCancellationSupport_closure4.doCall(GrailsCli.groovy:305)           在org.grails.cli.GrailsCli $ _handleCommandWithCancellationSupport_closure4.call(GrailsCli.groovy)   引起:org.gradle.internal.exceptions.LocationAwareException:   任务':startTscWatch'执行失败。           at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)           at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)           at org.gradle.initialization.StackTraceSanitizingExceptionAnalyser.transform(StackTraceSanitizingExceptionAnalyser.java:30)           在org.gradle.initialization.DefaultGradleLauncher $ 1.create(DefaultGradleLauncher.java:101)           在org.gradle.initialization.DefaultGradleLauncher $ 1.create(DefaultGradleLauncher.java:93)           在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)           在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)           在org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)           在org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)           at org.gradle.launcher.exec.InProcessBuildActionExecuter $ DefaultBuildController.run(InProcessBuildActionExecuter.java:94)           在org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:46)           在org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)           在org.gradle.tooling.internal.provider.runner.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:58)           在org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)           at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)           at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)           在org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:77)           在org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:47)           在org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)           在org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)           在org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)           在org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)           在org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)           在org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)           在org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)           在org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)           在org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)           在org.gradle.launcher.daemon.server.exec.ForwardClientInput $ 2.call(ForwardClientInput.java:74)           在org.gradle.launcher.daemon.server.exec.ForwardClientInput $ 2.call(ForwardClientInput.java:72)           在org.gradle.util.Swapper.swap(Swapper.java:38)           在org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)           在org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)           在org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47)           在org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)           在org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:66)           在org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)           在org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)           在org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)           在org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)           在org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)           在org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)           在org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)           在org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy $ 1.run(StartBuildOrRespondWithBusy.java:50)           在org.gradle.launcher.daemon.server.DaemonStateCoordinator $ 1.run(DaemonStateCoordinator.java:246)           at org.gradle.internal.concurrent.ExecutorPolicy $ CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)           at org.gradle.internal.concurrent.StoppableExecutorImpl $ 1.run(StoppableExecutorImpl.java:40)   引起:org.gradle.api.tasks.TaskExecutionException:执行   任务失败':startTscWatch'。           at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)           在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)           在org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)           在org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)           在org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)           在org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)           在org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)           在org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)           在org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)           在org.gradle.execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)           在org.gradle.execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)           at org.gradle.execution.taskgraph.Abs​​tractTaskPlanExecutor $ TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)           at org.gradle.execution.taskgraph.Abs​​tractTaskPlanExecutor $ TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)           在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)           在org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)           在org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)           在org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)           在org.gradle.execution.DefaultBuildExecuter.access $ 000(DefaultBuildExecuter.java:23)           在org.gradle.execution.DefaultBuildExecuter $ 1.proceed(DefaultBuildExecuter.java:43)           在org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)           在org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)           在org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)           在org.gradle.initialization.DefaultGradleLauncher $ 4.run(DefaultGradleLauncher.java:154)           在org.gradle.internal.Factories $ 1.create(Factories.java:22)           在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)           在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)           在org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:151)           在org.gradle.initialization.DefaultGradleLauncher.access $ 200(DefaultGradleLauncher.java:32)           在org.gradle.initialization.DefaultGradleLauncher $ 1.create(DefaultGradleLauncher.java:99)           ... 42更多引起:org.gradle.api.UncheckedIOException:java.io.IOException:无法运行程序" npm" (在目录"。"):   CreateProcess error = 2,系统找不到指定的文件           at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:43)           在org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:78)           在org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $ StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:227)           在org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $ StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)           在org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $ StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)           在org.gradle.api.internal.AbstractTask $ TaskActionWrapper.execute(AbstractTask.java:585)           在org.gradle.api.internal.AbstractTask $ TaskActionWrapper.execute(AbstractTask.java:568)           at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)           在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)           ... 70更多引起:java.io.IOException:无法运行程序" npm" (在目录"。"):CreateProcess error = 2,系统不能   找到指定的文件           at java_lang_ProcessBuilder $ start $ 1.call(Unknown Source)           在com.wiredforcode.gradle.spawn.SpawnProcessTask.buildProcess(SpawnProcessTask.groovy:58)           在com.wiredforcode.gradle.spawn.SpawnProcessTask.spawn(SpawnProcessTask.groovy:29)           在org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)           ... 77更多引起:java.io.IOException:CreateProcess error = 2,系统找不到指定的文件           ... 81更多|错误无法启动服务器

1 个答案:

答案 0 :(得分:0)

  

java.io.IOException的

代表输入/输出异常,因此gradle无法找到指定的文件:

  

无法运行程序" npm" (在目录"。")