警告:找不到任务“taskname”。 运行咕噜声时使用–force继续

我正在尝试使用'grunt-sass-convert'npm模块将.css文件转换为.sass文件。 ' Gruntfile.js '相同如下:

'use strict'; module.exports = function(grunt){ grunt.loadNpmTasks('grunt-sass-convert'); grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), Sass: { options: { // command line options here style: 'expanded', from: 'css', to: 'sass' }, files: { // Target-specific file lists and/or options go here. cwd: 'style', src: '*.css', filePrefix: '_', dest: 'sass/' } } }); grunt.registerTask('default',['Sass']); }; 

我提到了grunt-sass-convert npm模块文档来编写GruntFile.js文件。 在cmd中运行grunt命令时,出现以下错误:

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

我经历了很多关于同样的stackoverflow链接,但我无法修复它,所有我明白,在.js文件中有一些错误,这就是为什么它抛出的错误。

我使用的目录结构就像这里一样

谢谢..!!

我想这会帮助你 –

 'use strict'; module.exports = function(grunt){ grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), Sass: { options: { // command line options here style: 'expanded', from: 'css', to: 'sass' }, files: { // Target-specific file lists and/or options go here. cwd: 'style', src: '*.css', file_prefix: '_', dest: 'sass/' } } }); grunt.loadNpmTasks('grunt-sass-convert'); grunt.registerTask('default',['Sass']); };