使用grunt-sass编译node-sass,我得到错误“致命错误:原始错误".参数必须是函数类型. [英] Using grunt-sass to compile node-sass, I get the error "Fatal error: The "original" argument must be of type function."

查看:361
本文介绍了使用grunt-sass编译node-sass,我得到错误“致命错误:原始错误".参数必须是函数类型.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的gruntfile中的sass声明.

Here is my sass declaration in my gruntfile.

  sass: {
    dist: {
      options: {
        implementation: 'node-sass',
        style: 'expanded',
        noCache: true
        },
      files: {
        'dist/css/jk.css' : 'src/styles/jk.scss'
      }
    }
  },

这是运行grunt -v时的输出.

Here is the output when running 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正在执行,并且正在正确发送我的文件路径,但是由于某种原因返回了undefined.

It appears that sass is getting executed, and is sending my file paths correctly, but for some reason returning undefined.

我能够通过命令行手动编译sass文件,而没有任何问题.

I am able to compile my sass files manually by command line without any issue.

这是我package.json中的一些版本信息

Here's some version information from my package.json

"grunt": "^1.0.3"
"grunt-sass": "^3.0.1"
"node-sass": "^4.9.3"

推荐答案

您的Node版本是什么?

Whats your version of Node??

也看看这个

https://github.com/sindresorhus/grunt-sass/issues/288

这篇关于使用grunt-sass编译node-sass,我得到错误“致命错误:原始错误".参数必须是函数类型.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆