grunt serve from a fresh Yeoman install returns - Warning: Task “serve” not found

孤街醉人 提交于 2019-12-04 04:44:13
bitfidget

I think I have found a solution!

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

Running sudo on all the installs causes issues on the NPM folder in the home directory. I needed to change permissions of 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 go through the process again and no more errors!

The above link also seems to be pulled together from a bunch of answers at npm throws error without sudo

The Gruntfile.js is not present under app directory but the root directory, i.e. parent of the app directory.

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

I encountered similar error with "task --- not found" message.
I tried bitfidget's solution, but it couldn't help. It seemed to be different problem.
I updated yo and grunt-cli module like this:

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

and re-created whole project by "yo" command.
This solved the problem. I hope this can be help for anyone.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!