【问题标题】:Running old gruntfile grunt-contrib-sass error运行旧的 gruntfile grunt-contrib-sass 错误
【发布时间】:2019-08-02 20:05:52
【问题描述】:

寻找几个小时,仍然没有运气.. 尝试运行一个非常旧的 Gruntfile(带有 imagemin 和 sass),它曾经可以工作。 Imagemin 正在工作,而 sass 没有。

它抛出的错误是:

找不到名为“include-paths”的选项。 警告:退出并出现错误代码 64 使用 --force 继续。 由于警告而中止。

我安装了 npm。我安装了 grunt-contrib-sass。我已经安装了 sass 和 ruby​​。

sass 给出的地方: C:\Users..\AppData\Roaming\npm\sass C:\Users..\AppData\Roaming\npm\sass.cmd

红宝石给出的地方: C:\Ruby26-x64\bin\ruby.exe

这是我的 Gruntfile 的一个 sn-p,如果你需要额外的信息,我会把它完整地放进去:

    sass: {
        peter: {
            options: {
                compress: false,
                sourcemap: 'none'
            },
            files: [{
                expand: true,
                cwd: 'peter/css2/',
                src: ['**/*.scss'],
                dest: 'peter/',
                ext: '.css'
            }]
        },
        sots: {
            options: {
                compress: false,
                sourcemap: 'none'
            },
            files: [{
                expand: true,
                cwd: 'sots/css2/',
                src: ['**/*.scss'],
                dest: 'sots/',
                ext: '.css'
            }]
        }
      },
      options: {
        includePaths: ['bower_components/foundation/scss']
      },
    });


    grunt.loadNpmTasks('grunt-contrib-imagemin');
    grunt.loadNpmTasks('grunt-contrib-sass');
    grunt.loadNpmTasks('grunt-newer');
    //require('jit-grunt')(grunt);


    grunt.registerTask('build', ['sass']);
    grunt.registerTask('default', ['newer:imagemin', 'sass', 'build']);
}

【问题讨论】:

    标签: sass gruntjs


    【解决方案1】:

    没关系,扔掉 grunt-contrib-sass 并用 node-sass 替换它

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-04-16
      • 2017-10-15
      • 2016-04-08
      • 2023-03-12
      • 2014-12-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多