首页 > 解决方案 > 如何在 Intellij 中运行使用 npm 的 gradle 任务

问题描述

我有一个项目,我使用 gradle-node-plugin 来运行 npm install。当我从命令行运行时,一切正常。当我从 Intellij 运行时,我得到...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':npmInstall'.
> A problem occurred starting process 'command 'npm''

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 15s
2 actionable tasks: 2 executed
Cause: error=2, No such file or directory
1:17:15 PM: Task execution finished 'bootRun'.

似乎与正在运行的 Gradle Daemon 有关,因为有时 IJ 会导致它在终端上被冲洗,所以我必须在它再次工作之前将其杀死。

标签: node.jsgradleintellij-idea

解决方案


推荐阅读