Node.js 使用grunt sass编译节点sass,我得到错误;致命错误:在;“原件”;参数必须是function类型;
这是我在Grunfile中的sass声明Node.js 使用grunt sass编译节点sass,我得到错误;致命错误:在;“原件”;参数必须是function类型;,node.js,sass,gruntjs,Node.js,Sass,Gruntjs,这是我在Grunfile中的sass声明 sass: { dist: { options: { implementation: 'node-sass', style: 'expanded', noCache: true }, files: { 'dist/css/jk.css' : 'src/styles/jk.scss' } } }, 下面是运行grun
sass: {
dist: {
options: {
implementation: 'node-sass',
style: 'expanded',
noCache: true
},
files: {
'dist/css/jk.css' : 'src/styles/jk.scss'
}
}
},
下面是运行grunt-v时的输出
Running "sass:dist" (sass) task
Verifying property sass.dist exists in config...OK
Files: src/styles/jk.scss -> dist/css/jk.css
Options: precision=10, implementation="node-sass", style="expanded", noCache
undefined
Fatal error: The "original" argument must be of type function
似乎正在执行sass,并且正在正确发送我的文件路径,但由于某些原因返回未定义的路径
我能够通过命令行手动编译我的sass文件,没有任何问题
下面是my package.json中的一些版本信息
"grunt": "^1.0.3"
"grunt-sass": "^3.0.1"
"node-sass": "^4.9.3"
你的节点版本是什么 再看看这个
您对此仍有问题吗?
实现
选项不应该是字符串,请参见Roberto LL的答案。