After Yeoman scaffolding, "grunt serve" not working - gruntjs

I followed the Yeoman tutorial to the T yet it doesn't work for me.
I'm getting this error:
C:\Users\Imray\Projects\myProj\v2>grunt serve
Loading "imagemin.js" tasks...ERROR
>> Error: Cannot find module 'rimraf'
Loading "watch.js" tasks...ERROR
>> Error: Cannot find module 'lodash'
Running "serve" task
Warning: Task "watch" not found. Use --force to continue.
Aborted due to warnings.
Execution Time (2014-12-14 15:38:18 UTC)
loading tasks 9ms ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 45%
serve 9ms ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 45%
Total 20ms
Any ideas why I am getting this error and how to overcome it?

Looks like you do not have the dependencies properly installed.
Do a npm install and bower install, after successfull completion try grunt serve again.

Related

Why does grunt.loadNpmTask('grunt-contrib-jshint') trigger an error in Sails.js?

This seems pretty straightforward, but I can't seem to debug this error. I've added this code to my Sails API as /tasks/config/jshint.js
module.exports = function(grunt) {
console.log(1);
grunt.config.set('jshint', {
files: {
src: ['api/services/*.js', 'api/policies/*.js', 'api/controllers/*.js']
}
});
console.log(2);
grunt.loadNpmTask('grunt-contrib-jshint');
console.log(3);
};
Now, when I execute any grunt task, I get an error message (but the older tasks still execute successfully).
C:\dev\fo-rest-api>grunt aglio
1
2
Loading "Gruntfile.js" tasks...ERROR
>> TypeError: undefined is not a function
Running "aglio:your_target" (aglio) task
...
Done, without errors.
When I run the jshint task, I get the same loading error and the task is aborted.
C:\dev\fo-rest-api>grunt jshint
1
2
Loading "Gruntfile.js" tasks...ERROR
>> TypeError: undefined is not a function
Warning: Task "jshint" not found. Use --force to continue.
Aborted due to warnings.
C:\dev\fo-rest-api>
A few other notes:
Using --force only changes the wording of the error message.
grunt-contrib-jshint seems to be successfully installed in /node_modules (I deleted everything and re-ran npm install to be sure.
I'm running this on Windows, if that matters. I've tried opening the command line as both a normal user and as administrator.
I tried commenting out the loadNpmTask line to see if sails would load it automatically, but still got Warning: Task "jshint" not found.
Thanks for any clues you might have.
The answer was pretty straightforward. I somehow deleted the s at the end of grunt.loadNpmTasks. When I added it back, everything worked well.
I wish there was some sort of syntax highlighting that for common packages like grunt that would identify this kind of typo...

Yeoman angular build process issue

I am getting this error which I am unable to interprete correctly.
Can somebody give me a good hint.
Thanks a lot
Peter
Warning: Running "imagemin:dist" (imagemin) task
Fatal error: Cannot read property 'contents' of undefined
Execution Time (2015-11-29 16:40:32 UTC)
loading tasks 387ms ▇▇▇▇ 12%
loading grunt-contrib-imagemin 2.6s ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 79%
imagemin:dist 288ms ▇▇▇ 9%
Total 3.3s Used --force, continuing.
Running "imagemin:dist" (imagemin) task
Fatal error: Cannot read property 'contents' of undefined
I had a similar error.
In my case it helped doing:
sudo npm cache clean && npm install grunt-contrib-imagemin
Try updating "grunt-contrib-imagemin": "^1.0.0" in your package.json.
More info here: https://github.com/gruntjs/grunt-contrib-imagemin/issues/325

Error on Cloud 9 While trying to install and run MEAN stack

I have installed the mean stack with bower and grunt on cloud 9 server but every time I try to run:
gwenf1#basejump_voting:~/workspace $ grunt serve
I get the follwing errors:
Running "serve" task
Running "clean:server" (clean) task
Running "env:all" (env) task
Running "concurrent:server" (concurrent) task
Running "injector:scripts" (injector) task
Missing option `template`, using `dest` as template instead
Injecting js files (13 files)
Running "injector:css" (injector) task
Missing option `template`, using `dest` as template instead
Injecting css files (5 files)
Running "wiredep:target" (wiredep) task
client/index.html modified.
Loading "autoprefixer.js" tasks...ERROR
>> Error: Cannot find module 'caniuse-db/features-json/transforms2d'
Warning: Task "autoprefixer" failed. Use --force to continue.
Aborted due to warnings.
Execution Time (2015-08-31 04:28:36 UTC)
loading tasks 173ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 18%
serve 15ms ▇▇ 2%
clean:server 26ms ▇▇▇ 3%
env:all 12ms ▇▇ 1%
concurrent:server 13ms ▇▇ 1%
injector:scripts 103ms ▇▇▇▇▇▇▇▇▇▇▇ 11%
injector:css 17ms ▇▇ 2%
wiredep:target 613ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 63%
Total 976ms
gwenf1#basejump_voting:~/workspace $ grunt serve
Running "serve" task
Running "clean:server" (clean) task
Running "env:all" (env) task
Running "concurrent:server" (concurrent) task
Running "injector:scripts" (injector) task
Missing option `template`, using `dest` as template instead
Injecting js files (13 files)
Running "injector:css" (injector) task
Missing option `template`, using `dest` as template instead
Injecting css files (5 files)
Running "wiredep:target" (wiredep) task
Loading "autoprefixer.js" tasks...ERROR
>> Error: Cannot find module 'caniuse-db/features-json/transforms2d'
Warning: Task "autoprefixer" failed. Use --force to continue.
Aborted due to warnings.
I have tried installing different versions of everything and deleting the workspace and starting over.

Grunt autoprefixer error - Can't parse CSS: property missing value near line 12:21

When I run grunt serve or grunt autoprefixer a warning occurs but there is no mention to file path, just line and column.
$ grunt autoprefixer
Running "autoprefixer:dist" (autoprefixer) task
Warning: Can't parse CSS: property missing value near line 12:21 Use --force to continue.
Aborted due to warnings.
Execution Time (2014-05-05 20:24:50 UTC)
loading tasks 3ms ■■■■■■■■■■■ 13%
autoprefixer:dist 19ms ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 83%
Total 23ms
How can I resolve this problem?
Thanks for all!
Use grunt autoprefixer --verbose to run Grunt in verbose mode and have it spit out the file names and expanded options object

Grunt-karma aborted due to warnings

I'm getting "Aborted due to warnings" error when running grunt in --verbose mode.
ar#Woody:~/www/mysite-frontend-dev$ grunt build:debug
...
Registering "grunt-karma" local Npm module tasks.
Reading /home/ar/www/mysite-frontend-dev/node_modules/grunt-karma/package.json...OK
Parsing /home/ar/www/mysite-frontend-dev/node_modules/grunt-karma/package.json...OK Use --force to continue.
Aborted due to warnings.
Is there a way to get more detailed output? This warning message doesn't say much...
In general you can pass a command-line flag like $ grunt build:debug --verbose or $ grunt build:debug --stack to see more details
There was an issue with grunt-concurrent and Debian "squeeze". Updating to the latest (0.4.1) grunt-concurrent resolved the problem.

Resources