Using grunt-sass to compile node-sass, I get the e

2019-09-04 12:06发布

问题:

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'
      }
    }
  },

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

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

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

Here's some version information from my package.json

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

回答1:

Whats your version of Node??

also look at this

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