问题
I've been using PhpStorm's grunt task runner for a while now. But after a update to PhpStorm to version 10 it stopped working. I'm getting and error;
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
Even though it says "/usr/local/lib/node_modules/grunt-cli/bin/grunt
not found", file is actually there. Then I made the permission to 777 to see if it is permission issue. But it still giving me the same error.
My Grunt settings says,
But same Grunt file works perfectly on CLI mode, which is what I'm using at the moment. But I prefer to use PhpStorm grunt task runner as it'll be easier for me to manage all my dev work through one IDE.
I tried few things, and read few documents. Nothing about this particular scenario.
回答1:
Based on screenshot of your "Grunt Settings" dialog: you did put the path to your grunt in the field that asks for a path to Node Interpreter.
Providing path to the actual node executable should fix the issue for you.
Even though it says "/usr/local/lib/node_modules/grunt-cli/bin/grunt not found", file is actually there.
Nope.
If you read it again it actually says "Task xxx nod found". This suggests that most likely you either using wrong parameters (wrong values or wrong order) .. or parameters are right but actual program is wrong.
来源:https://stackoverflow.com/questions/35329807/phpstorm-fail-to-list-grunt-tasks