Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run Grunt as a external tool from IntelliJ?

I've tried to run Grunt.js before I compile and launch my project without any luck.

I've tried to run it with the "Run External Tool" option in IntelliJ configuration edition menu, it asks you for the path of the program you want to run, I've tried to add the Grunt path in /usr/bin but it tells me that the node environment cannot be found.

like image 962
DanielDiSu Avatar asked Sep 19 '13 12:09

DanielDiSu


People also ask

How do I run local grunt?

Installing grunt-cli locally json to run the associated grunt command: "scripts": { "test": "grunt test" } . Now npm test will use the locally installed ./node_modules/. bin/grunt executable to run your Grunt commands. To read more about npm scripts, please visit the npm docs: https://docs.npmjs.com/misc/scripts.

How do I add grunt?

The easiest way to add Grunt and gruntplugins to an existing package. json is with the command npm install <module> --save-dev . Not only will this install <module> locally, but it will automatically be added to the devDependencies section, using a tilde version range.


1 Answers

This answer helped me more than what you selected as the correct answer. The difference is that this one is for webstorm. Here's what I'd do: I'd install the node.js plugin in intellij, then configure it like this:

  • Path to Node: C:\Program Files\nodejs\node.exe
  • Working Directory: directory with your Gruntfile.js in it
  • Path to Node App JS File: C:\Users\yourusername\AppData\Roaming\npm\node_modules\grunt-cli\bin\grunt
  • Application Parameters: Whatever you want to pass to grunt as parameters

This is on windows 7.

like image 93
Daniel Kaplan Avatar answered Oct 12 '22 12:10

Daniel Kaplan