Gulp-autoprefixer throwing ReferenceError: Promise is not defined

后端 未结 4 1961
长情又很酷
长情又很酷 2021-01-30 02:18

I try to make a gulp compile my sass then autoprefixit with gulp-autoprefixer but i\'m getting an error.

var gulp = require(\'gulp\'),
    sass = re         


        
4条回答
  •  太阳男子
    2021-01-30 02:33

    I updated node.js to the latest version using :

    # Using Ubuntu
    curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
    sudo apt-get install -y nodejs
    

    for my Ubuntu machine, as shown here.

    After that i updated NPM using :

    sudo npm cache clean -f
    sudo npm install -g n
    sudo n stable
    

    As shown here.

    Now the gulp-autoprefixer start working but i got an error from gulp-sass. I updated it using this instruction :

    1. Delete your node_modules folder
    2. Remove gulp-sass from your package.json file
    3. Remove node-sass from your package.json file (if you have it in there)
    4. Run npm install gulp-sass --save-dev
    5. Update your Gulp task as required

    Found here.Now i have "gulp-sass": "^2.0.4" and this fixed all my problems.

    Thanks for advice and help.

提交回复
热议问题