node sass release 3.5.3 is breaking build

2020-02-14 07:05发布

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.

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

how to go back to node sass 3.4.2?

Error Message

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"
  }
}

1条回答
别忘想泡老子
2楼-- · 2020-02-14 07:45

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.

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"
        }
      }
    }
  }
}

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

查看更多
登录 后发表回答