Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
548 views
in Technique[技术] by (71.8m points)

gulp - node sass release 3.5.3 is breaking build

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"
  }
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...