defteH
defteH

Reputation: 141

Grunt.js Installation Issue - Command Not Found

I'm trying to get grunt.js set up on my work machine. Now I've managed to get it set up at home, so I pushed my repository, then cloned it on my work machine, however despite troubleshooting this to death I've always run into the same issue when I come to try and run the command on my work computer;

sh.exe": grunt: command not found

So some background and explanation;

Now I'm pretty green to this command line stuff, so I may have overlooked something very obvious but I feel like I've tried every guide going to get this thing to work.

Despite running through the getting started steps/installing grunt documentation repeatedly, it seems no matter what I do the terminal will not pick up grunt as a recognized command.

Am I stupid or is this some other issue?

EDIT 1: contents of my package.json:

{ "name" : "xxxxxxxxx", "version" : "xxxx", "dependencies" : { "grunt":"~0.4.1", "grunt-contrib-watch": "~0.5.3", "grunt-contrib-compass": "~0.5.0", "grunt-contrib-uglify": "~0.2.2", "matchdep": "~0.1.2" } }

Upvotes: 1

Views: 5289

Answers (2)

athms
athms

Reputation: 958

This is happening because you are using the Aptana Terminal, which needs the PATH variable to work out what is meant by grunt etc. A normal cmd prompt would work fine with the command npm install grunt-cli -g but in this context the terminal is unaware of what grunt is.

As per the following existing answer, you need to set up your Windows PATH variable to make the Aptana Terminal aware of the npm directory: https://stackoverflow.com/a/19137584/463205

C:\Users\Username\AppData\Roaming\npm

Closing the terminal and reopening it after setting the PATH correctly should enable you to run the command successfully.

Upvotes: 3

Alexey Shcherbak
Alexey Shcherbak

Reputation: 3454

Try to run

npm install grunt-cli -g

On your home computer. -g means - install Grunt globally (not in the project node_modules folder), so it'll add grunt command to the bin folder which is used by nodejs console ( and you need to run node.js command prompt, not just arbitrary cmd)

Upvotes: 3

Related Questions