作者:夜晨在行动 | 来源:互联网 | 2022-12-07 17:31
运行咕unt声-我收到此错误消息:
Running "sass:all" (sass) task
Fatal error: The implementation option must be passed to the Sass task
我试过重新安装grunt,node,npm,dependencies-但我总是回到这个无法逾越的错误。
我应该发布我的Gruntfile.js吗?坦白说,这是由第三方建立的,我们不经常使用-我想也许我们应该从头开始,因为它最初是大约4年前的...但是想知道是否有人看到过此错误之前,并且知道修复程序/解决方法。
1> Michaël Vand..:
随着grunt-sass 3的更新,您必须选择要使用node-sass还是dart-sass进行编译对于node-sass,您需要使用以下命令安装模块:
$ npm install --save-dev node-sass
在gruntfile中,您需要添加node-sass作为要求,并添加define constant作为实现选项:
const sass = require('node-sass');
require('load-grunt-tasks')(grunt);
grunt.initConfig({
sass: {
options: {
implementation: sass,
sourceMap: true
},
dist: {
files: {
'main.css': 'main.scss'
}
}
}
});
另请参阅官方页面以获取更多详细信息:https : //www.npmjs.com/package/grunt-sass