我是 Grunt 的新手。每当我运行 Grunt 命令时,它都会发出此警告并中止。警告如下。
加载“Gruntfile.js”任务...错误
TypeError:对象#没有方法'loadNpmtasks'警告:找不到任务“默认”。使用 --force 继续。
由于警告而中止。
我知道以前有人问过这类问题。我已经看到了那些答案。它们都有一些语法错误。我在我的里面找不到任何东西。我的代码已在下面给出。
module.exports = function(grunt){
grunt.initConfig({
pkg : grunt.file.readJSON('package.json'),
concat : {
dist : {
src : [
'something.js',
'anything.js'
], dest : 'new.js'
}
}
});
grunt.loadNpmtasks('grunt-contrib-concat');
grunt.registertasks('default', ['concat']);
};