【问题标题】:PhpStorm fail to list grunt tasksPhpStorm 无法列出 grunt 任务
【发布时间】:2016-02-11 02:34:18
【问题描述】:

我使用 PhpStorm 的 grunt 任务运行器已经有一段时间了。但是在将 PhpStorm 更新到版本 10 后,它停止了工作。我得到了错误;

Failed to list grunt tasks in /js/gruntfile.js: process finished with exit code 3 (a non-zero exit code means an error)
Running tasks: /usr/local/lib/node_modules/grunt-cli/bin/grunt, _intellij_grunt_tasks_fetcher
Warning: Task "/usr/local/lib/node_modules/grunt-cli/bin/grunt" not found. Use --force to continue

Aborted due to warnings.

Process finished with exit code 3

即使它说“/usr/local/lib/node_modules/grunt-cli/bin/grunt 未找到”,文件实际上是存在的。然后我对777进行了许可,看看是否是许可问题。但它仍然给我同样的错误。

我的 Grunt 设置显示,

但同样的 Grunt 文件在 CLI 模式下完美运行,这是我目前使用的。但我更喜欢使用 PhpStorm grunt 任务运行器,因为它可以让我更轻松地通过一个 IDE 管理我的所有开发工作。

我尝试了一些东西,并且阅读了一些文件。与此特定场景无关。

【问题讨论】:

  • 您的“Grunt Settings”屏幕要求输入“Node Interpreter”——为什么要将 grunt 的路径放在那里?
  • 一个绝对的无赖...谢谢你的人..为什么我没有看到:o。无论如何,现在一切都很好,它必须是 /usr/local/bin/node 而不是 /usr/local/bin/grunt

标签: gruntjs phpstorm


【解决方案1】:

根据您的“Grunt Settings”对话框的屏幕截图:您确实将 grunt 的路径放在了要求 Node Interpreter 路径的字段中。

提供实际节点可执行文件的路径应该可以为您解决问题。


即使它说“/usr/local/lib/node_modules/grunt-cli/bin/grunt not found”,文件实际上是存在的。

没有。

如果你再读一遍,它实际上是说“Task xxx nod found”。这表明您很可能使用了错误的参数(错误的值或错误的顺序).. 或者参数正确但实际程序错误。

【讨论】:

  • 是的,是解释器路径错误,应该是/usr/local/bin/node。谢谢!!
猜你喜欢
  • 2017-08-08
  • 1970-01-01
  • 2013-05-25
  • 1970-01-01
  • 2020-04-22
  • 1970-01-01
  • 2015-12-11
  • 2016-03-18
  • 1970-01-01
相关资源
最近更新 更多