2014-04-18 59 views
0

我試圖學習Grunt,並創建一個文件,光盤到那裏,並使用grunt命令,但不執行我的文件,但執行其他屬於個人項目與yeoman合作,無論在終端中的位置,始終運行該項目。我使用:Grunt命令總是運行相同的Gruntfile

$ 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']); 

}; 

錯誤顯示任務 「更新:jshint」 沒有找到,但在我的文件我不使用它!你能幫我嗎?

回答

0

您是否嘗試過使用CD到項目目錄中,然後執行npm install來確保安裝了包文件中定義的所有模塊,然後運行grunt命令?

+0

是的,就像我說的那樣,我cd到那裏(我不知道你是否可以說英文,對不起),我做了npm安裝,錯誤顯示任務「更新:jshint」找不到,但在我的文件我不使用它!謝謝你的回答,還有其他人嗎? – bluesky777

+0

你可以嘗試一個咕嚕--verbose,看看這是否揭示任何額外的信息? –

+0

好吧,它顯示了許多信息,一切都成功了,因爲它運行了我用yeoman創建的舊角度項目之一,它運行的任務太多,比如grunt-autoprefixer,grunt-contrib-cssmin和更多。 – bluesky777

相關問題