Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gruntjs Grunt命令始终运行相同的GrunFile_Gruntjs - Fatal编程技术网

Gruntjs Grunt命令始终运行相同的GrunFile

Gruntjs Grunt命令始终运行相同的GrunFile,gruntjs,Gruntjs,我正在尝试学习Grunt,我创建了一个文件,cd到那里,并使用Grunt命令,但不执行我的文件,而是执行另一个属于用yeoman制作的个人项目的文件,并且无论终端中的位置如何,始终运行该项目。我使用: $grunt--base”/Users/user/Documents/Ejercicios angular/Ui routes tutorial/“ 它告诉我: Warning: Task "newer:jshint" not found. Use --force to continue. Abo

我正在尝试学习Grunt,我创建了一个文件,cd到那里,并使用Grunt命令,但不执行我的文件,而是执行另一个属于用yeoman制作的个人项目的文件,并且无论终端中的位置如何,始终运行该项目。我使用:

$grunt--base”/Users/user/Documents/Ejercicios angular/Ui routes tutorial/“

它告诉我:

Warning: Task "newer:jshint" not found. Use --force to continue.
Aborted due to warnings.

Execution Time (2014-04-18 13:41:21 UTC)
loading tasks  3ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 60%
default        2ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 40%
Total 5ms
这是我的档案:

module.exports = function(grunt) {

// Project configuration.
  grunt.initConfig({
   pkg: grunt.file.readJSON('package.json'),
  uglify: {
     options: {
      banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
    },
     build: {
       src: 'src/<%= pkg.name %>.js',
      dest: 'build/<%= pkg.name %>.min.js'
    }
  }
 });

  // Load the plugin that provides the "uglify" task.
 grunt.loadNpmTasks('grunt-contrib-uglify');

 // Default task(s).
  grunt.registerTask('default', ['uglify']);

};
module.exports=函数(grunt){
//项目配置。
grunt.initConfig({
pkg:grunt.file.readJSON('package.json'),
丑陋的:{
选项:{
横幅:'/*!*/\n'
},
建造:{
src:'src/.js',
dest:'build/.min.js'
}
}
});
//加载提供“丑”任务的插件。
grunt.loadNpmTasks(“grunt-contrib-uglify”);
//默认任务。
registerTask('default',['uglify']);
};

错误显示找不到任务“更新的:jshint”,但在我的文件中我不使用它!你能帮我一下吗?

你有没有试过将CD刻录到项目目录,然后进行npm安装以确保安装了包文件中定义的所有模块,然后运行grunt命令?

是的,就像我说的,我将CD刻录到那里(对不起,我不知道你是否可以用英语说),我进行了npm安装,错误显示为Task更新:jshint“找不到,但在我的文件中我不使用它!谢谢你的回答,还有其他的吗?你能试一下grunt——详细的,看看这是否揭示了任何额外的信息吗?好的,它显示了很多信息,一切都成功了,因为它运行了我用yeoman创建的一个旧angular项目,它运行了太多的任务,比如grunt autoprefixer、grunt contrib cssmin等等。好的,运行该命令时,控制台中的路径是否正确?听起来grunt命令正在启动另一个包。当你安装grunt CI时,你是全局安装的吗?在安装了太多Gruntfile.js之后,我在我的用户文件夹中意外发现了一个由yeoman创建的Gruntfile.js,grunt命令在它应该在的文件夹中工作,但现在说
找不到有效的Gruntfile。
致命错误:找不到Gruntfile与相同,我还能做什么?谢谢