Grunt Serve from Fresh Yeoman Installation Returns - Warning: Task to β€œServe” Not Found

After running yo angular and then cd 'to the root folder of the application (at the same level as the application folder, gruntfile , package.json , etc.), I try grunt serve and I get the above error. Grunt will not start the server for me.

I searched everything, but could not find that I needed to run npm install and bower install in the root directory of the application that I tried, but still the same error.

I updated and checked bower / grunt / npm and they are all good.

Any suggestions please?

+7
angularjs gruntjs yeoman yeoman-generator-angular
source share
3 answers

I think I found a solution!

http://yang-wei.imtqy.com/blog/2014/06/01/npm-install-issues-plus-angularjs-set-up/

Running sudo on all installations causes problems in the NPM folder in the home directory. I needed to change permissions for all usr / local folders by running:

sudo chown -R $USER /usr/local

sudo chown -R `whoami` ~/.npm

npm install -g yo grunt-cli bower

Now I will go through the process again and get no more errors!

The above link also seems to be pulled together from a bunch of answers on npm giving an error without sudo

+6
source share

Gruntfile.js not in the app directory, but in the root directory, i.e. parent the app directory.

You must run grunt serve form of the root directory, i.e. parent the app directory.

0
source share

I encountered a similar error with the message "task --- not found".
I tried the bitfidget solution, but that did not help. This seemed to be another problem.
I updated the yo module and grunt-cli as follows:

  npm update -g yo
 npm update -g grunt-cli

and recreated the whole project with the yo command.
This solved the problem. I hope this can help anyone.

0
source share

All Articles