7

I have followed this link to try to install a mean.js stack on an ubuntu server.

Regarding grunt, in /opt/mean, I have done

sudo npm install -g bower grunt-cli
sudo npm install grunt --save-dev
sudo npm install

However, grunt or grunt jshint inside the folder gives

A valid Gruntfile could not be found. Please see the getting started guide for more information on how to configure grunt: http://gruntjs.com/getting-started Fatal error: Unable to find Gruntfile.

Note that npm start works, and http://server_domain_or_IP:3000 can display the sample application.

Does anyone know how to fix the grunt error?

SoftTimur
  • 5,630
  • 38
  • 140
  • 292

2 Answers2

3

As the error states, you do not have a Gruntfile and https://gruntjs.com/getting-started shows you an example of one.

Simply installing Grunt is not enough. When you run grunt it needs a configuration file (your Gruntfile) to run any tasks. The Gruntfile itself contains the tasks to be run.

AJ Funk
  • 3,099
  • 1
  • 16
  • 18
2

You will need a Gruntfile.js in your project. you can create the same using the following grunt command.

grunt-init gruntfile

The above command will create the sample gruntfile.js file in your project.

Rahul Tokase
  • 1,048
  • 9
  • 25