Ich versuche Grunt Aufgaben einzurichten, aber ich erhalte eine Warnung im TerminalAufgaben Verzeichnis "grunzen" nicht gefunden
*>> Tasks directory "grunt" not found.
Warning: Task "undefined" not found. Use --force to continue.
Aborted due to warnings.*
ich ein Beispiel für develomment NODE + Angular hergestellt von Sr. Carlos Santana am Lernen in dieses Video 3: https://www.youtube.com/watch?v=juDeLmGjX8k
Grunt Version:
Grunzen-cli v1.2.0 Grunzen v1.0.1
Knoten Version: v5.1.0
Gruntfile.js
'use strict';
module.exports = function(grunt){
grunt.loadNpmTasks('grunt-jscs');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-githooks');
grunt.loadNpmTasks('grunt-shell');
grunt.loadTasks('grunt');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jscs:{
options:{
config: '.jscsrc',
reporter: 'checkstyle'
},
src: [
'Gruntfile.js',
'src/**/*.js',
'!src/public/bower_components/**'
]
},
jshint:{
options: {
jshintrc: '.jshintrc',
reporter: 'checkstyle'
},
src: [
'Gruntfile.js',
'src/**/*.js',
'!src/public/bower_components/**'
]
},
githooks: {
all: {
options:{
endMarker: ''
},
'pre-commit': 'analyze',
'post-checkout': 'shell:gitLog',
'post-commit': 'shell:gitLog',
'post-merge': 'shell:gitLog shell:npmInstall'
}
},
shell: {
gitLog: {
command: 'git log -1 > git-info.txt'
},
npmInstall: {
command: 'npm install'
},
serverLogs: {
command: 'pm2 logs'
},
serverStatus: {
command: 'pm2 list'
},
serverStop: {
command: 'pm2 kill'
},
serverDelete: {
command: 'pm2 delete pm2.json'
},
serverStart:{
command: 'pm2 start pm2.json'
}
}
});
grunt.registerTask('default', ['analyze']);
grunt.registerTask('analyze', 'Validate code style' ['jshint', 'jscs']);
grunt.registerTask('status', 'Shows status os node processes', ['shell:serverStatus']);
grunt.registerTask('stop', 'Stop node processes', ['shell:serverStop']);
grunt.registerTask('start', 'Start node processes', ['shell:serverStart']);
grunt.registerTask('restart', 'Restart node processes', ['stop', 'start']);
grunt.registerTask('logs', 'Tail logs for all pm2 processes', ['shell:serverLogs']);
};
Package.json
{
"name": "StudioVictory",
"version": "0.0.1",
"private": true,
"scripts": {
"preinstall": "npm prune",
"postinstall": "bower prune; bower install; grunt githooks"
},
"autor": "Carlos Santana",
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/XXX/XX.git"
},
"dependencies": {
"body-parser": "~1.15.1",
"cookie-parser": "~1.4.3",
"debug": "~2.2.0",
"express": "~4.13.4",
"express-handlebars": "latest",
"lodash": "*",
"morgan": "~1.7.0",
"stylus": "latest",
"nib": "latest",
"js-yaml": "latest"
},
"devDependencies": {
"bower": "latest",
"grunt": "latest",
"grunt-contrib-jshint": "latest",
"grunt-githooks": "latest",
"grunt-jscs": "latest",
"grunt-npm-install": "latest",
"grunt-shell": "latest"
}
}
Executing: Grunzen -v:
Initializing
Command-line options: --verbose
Reading "Gruntfile.js" Gruntfile...OK
Registering Gruntfile tasks.
Registering "grunt-jscs" local Npm module tasks.
Reading C:\JACS\WampServer2.5\www\NODEJS\StudioVictory\node_modules\grunt-jscs\package.json...OK
Parsing C:\JACS\WampServer2.5\www\NODEJS\StudioVictory\node_modules\grunt-jscs\package.json...OK
Loading "jscs.js" tasks...OK
+ jscs
Registering "grunt-contrib-jshint" local Npm module tasks.
Reading C:\JACS\WampServer2.5\www\NODEJS\StudioVictory\node_modules\grunt-contrib-jshint\package.json...OK
Parsing C:\JACS\WampServer2.5\www\NODEJS\StudioVictory\node_modules\grunt-contrib-jshint\package.json...OK
Loading "jshint.js" tasks...OK
+ jshint
Registering "grunt-githooks" local Npm module tasks.
Reading C:\JACS\WampServer2.5\www\NODEJS\StudioVictory\node_modules\grunt-githooks\package.json...OK
Parsing C:\JACS\WampServer2.5\www\NODEJS\StudioVictory\node_modules\grunt-githooks\package.json...OK
Loading "githooks.js" tasks...OK
+ githooks
Registering "grunt-shell" local Npm module tasks.
Reading C:\JACS\WampServer2.5\www\NODEJS\StudioVictory\node_modules\grunt-shell\package.json...OK
Parsing C:\JACS\WampServer2.5\www\NODEJS\StudioVictory\node_modules\grunt-shell\package.json...OK
Loading "shell.js" tasks...OK
+ shell
Registering "grunt" tasks.
>> Tasks directory "grunt" not found.
Reading package.json...OK
Parsing package.json...OK
Initializing config...OK
Loading "Gruntfile.js" tasks...OK
+ analyze, default, logs, restart, start, status, stop
No tasks specified, running default tasks.
Running tasks: default
Running "default" task
Running "analyze" task
Warning: Task "undefined" not found. Use --force to continue.
Aborted due to warnings.
Executing: Grunzen Grunzen
C:\JACS\WampServer2.5\www\NODEJS\StudioVictory>grunt grunt
>> Tasks directory "grunt" not found.
Warning: Task "grunt" not found. Use --force to continue.
Aborted due to warnings.
können Sie die Grunt-Aufgabe, die Sie ausführen, und diese Aufgabe in Ihrer Gruntfile.js anzeigen? – joncodo