【问题标题】:grunt-contrib-sass doesn't work in Windowsgrunt-contrib-sass 在 Windows 中不起作用
【发布时间】:2015-09-06 17:20:51
【问题描述】:

我正在尝试使用 Grunt 将 scss 文件编译为 css,但由于未知原因我失败了。

这是我的 Gruntfile.js

module.exports = function(grunt) {

    grunt.initConfig({
        bower: {
            install: {
                options: {
                    targetDir: 'dependencies',
                    cleanup: true,
                    layout: 'byComponent'
                }
            }
        },
        sass: {
            foundation: {
                files: {
                    'a.css': 'a.scss'
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-bower-task');
    grunt.loadNpmTasks('grunt-contrib-sass');

    grunt.registerTask('dependencies', ['bower:install']);
    grunt.registerTask('assets', ['sass:foundation']);
};

我收到以下错误:

> grunt assets
Running "sass:foundation" (sass) task
Warning: spawn C:\Windows\system32\cmd.exe;C\MySQL\bin ENOENT Use --force to continue

Aborted due to warnings.

我做错了什么?

【问题讨论】:

  • 为什么要发布错误的屏幕截图而不是复制/粘贴错误?

标签: node.js sass gruntjs


【解决方案1】:

我解决了这个问题,安装了“grunt-contrib-sass”:“^0.8.1”(这是一个旧版本,但它对我有用)

"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-sass": "^0.8.1"
}

【讨论】:

    猜你喜欢
    • 2015-07-11
    • 1970-01-01
    • 2016-07-31
    • 1970-01-01
    • 2014-05-27
    • 2023-03-12
    • 2017-10-15
    • 1970-01-01
    • 2016-04-08
    相关资源
    最近更新 更多