node sass 版本 3.5.3 正在破坏构建 [英] node sass release 3.5.3 is breaking build

查看:9
本文介绍了node sass 版本 3.5.3 正在破坏构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这也是目前使用 gulp-sass 的项目.gulp-sass 依赖于 node-sass#^3.4.1,它刚刚自动更新到 3.5.3,这是一个破坏性版本.

This is also currently biting my project, which uses gulp-sass. gulp-sass depends on node-sass#^3.4.1 which just automatically updated to 3.5.3 which is a breaking release.

通过更新package.json 文件,但它仍在中断.

I have degraded my gulp sass version to the older(2.1.0) by updating the package.json file but its still breaking.

如何回到node sass 3.4.2?

how to go back to node sass 3.4.2?

错误信息

错误:您不能从@media 中@extend 外部选择器.您只能在同一指令中 @extend 选择器.

Error: You may not @extend an outer selector from within @media. You may only @extend selectors within the same directive.

{
  "version": "1.0.0",
  "name": "abcd",
  "devDependencies": {
     "bower": "^1.3.12",
    "express": "^4.12.3",
    "gulp": "^3.8.10",
    "gulp-autoprefixer": "^2.1.0",
    "gulp-bower": "^0.0.7",
    "gulp-concat": "^2.5.2",
    "gulp-install": "^0.4.0",
    "gulp-livereload": "^3.8.0",
    "gulp-minify-css": "^1.0.0",
    "gulp-plumber": "^1.0.0",
    "gulp-sass": "2.1.0",
    "gulp-sourcemaps": "^1.5.1",
    "gulp-uglify": "^1.1.0"
  },
  "dependencies": {
    "jquery": "1.11.1"
  }
}

推荐答案

貌似新版本刚刚发布允许 node-sass 的错误"版本,但您始终可以 npm shrinkwrap 将特定的子依赖项添加到如果需要,请使用特定版本 - 假设主包与该依赖项版本兼容.

Looks like a new version was just released that allows the "buggy" version of node-sass but you can always npm shrinkwrap specific sub-dependencies to a specific version if you need to - assuming that the primary package is compatible with that dependency version.

这会将 gulp-sass 中的 node-sass 版本锁定到 3.4.2:

This will lock the node-sass version in gulp-sass to 3.4.2:

{
  "name": "yourprojectname",
  "version": "1.0.0",
  "dependencies": {
    "gulp-sass": {
      "version": "2.3.1",
      "from": "gulp-sass@>=2.3.1 <3.0.0",
      "resolved": "https://registry.npmjs.org/gulp-sass/-/gulp-sass-2.3.1.tgz",
      "dependencies": {
        "node-sass": {
          "version": "3.4.2"
        }
      }
    }
  }
}

确保删除您的 node_modules npm cache clean在再次运行 npm install 之前清除本地缓存的包.

Make sure you delete your node_modules npm cache clean to clear your locally cached packages before running npm install again.

这篇关于node sass 版本 3.5.3 正在破坏构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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