Getting grunt.js to work on a pre-existing yeoman project
I have a working yeoman project, which I run the server with
grunt server, it works fine.
I put the entire thing into a git repo, and checked it out to a new folder…
when I try doing ‘grunt server’ it says:
Fatal error: Unable to find local grunt.
If you’re seeing this message, either a Gruntfile wasn’t found or grunt
hasn’t been installed locally to your project.
I am having trouble getting grunt installed locally to that directory, and being able to locate and use the GruntFile.
3 Solutions collect form web for “Getting grunt.js to work on a pre-existing yeoman project”
After you check out a Yeoman project, you need to install the npm modules and bower components like you did after the initial scaffolding process, as they are not part of the git repository:
npm install & bower install
I just ran into this today!
By default your .gitignore will be ignoring /bower_components, node_modules, dist folder, etc.
When you pull the project from git, just be sure to run npm install, and bower install, and you should be good to go after that!
You will need to install some https://github.com/gruntjs/grunt-contrib packages. The gruntserver output (installed as Scott’s answer) will tell you what are the missing ones