Search code examples
laravellaravel-elixir

Unable to use Elixir after upgrade


I upgraded my Elixir version from 3.0 to 5.0. The npm update command runs fine but when I try to run gulp --production it fails.

I have given the error below which I get.

My package.json file (which should be identical to the one at https://github.com/laravel/laravel/blob/master/package.json)

{
  "private": true,
  "scripts": {
  "prod": "gulp --production",
  "dev": "gulp watch"
  },

 "devDependencies": {
 "gulp": "^3.9.1",
 "laravel-elixir": "^5.0.0",
 "bootstrap-sass": "^3.3.0"
  }
}

When running gulp --production I get the below error

/home/vagrant/Code/laravel/node_modules/laravel-  elixir/node_modules/gulp- cssnano/node_modules/cssnano/node_modules/postcss/lib/lazy-result.js:157
    this.processing = new Promise(function (resolve, reject) {
                          ^
ReferenceError: Promise is not defined
at LazyResult.async (/home/vagrant/Code/laravel/node_modules/laravel-elixir/node_modules/gulp-cssnano/node_modules/cssnano/node_modules/postcss/lib/lazy-result.js:157:31)
at LazyResult.then (/home/vagrant/Code/laravel/node_modules/laravel-elixir/node_modules/gulp-cssnano/node_modules/cssnano/node_modules/postcss/lib/lazy-result.js:79:21)
at Transform.stream._transform (/home/vagrant/Code/laravel/node_modules/laravel-elixir/node_modules/gulp-cssnano/index.js:27:17)
at Transform._read (_stream_transform.js:179:10)
at Transform._write (_stream_transform.js:167:12)
at doWrite (_stream_writable.js:226:10)
at writeOrBuffer (_stream_writable.js:216:5)
at Transform.Writable.write (_stream_writable.js:183:11)
at write (/home/vagrant/Code/laravel/node_modules/laravel-elixir/node_modules/gulp-concat/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
at flow (/home/vagrant/Code/laravel/node_modules/laravel-elixir/node_modules/gulp-concat/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7)

Solution

  • You need to upgrade Node also.

    You can read here how it can be updated upgraded:
    https://askubuntu.com/questions/426750/how-can-i-update-my-nodejs-to-the-latest-version