升级后无法使用Elixir

时间:2016-05-11 13:56:32

标签: laravel laravel-elixir

我将Elixir版本从3.0升级到5.0。 npm update 命令运行正常,但是当我尝试运行 gulp --production 时,它会失败。

我已经给出了以下错误。

我的package.json文件(应该与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"
  }
}

运行gulp --production时出现以下错误

/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)

1 个答案:

答案 0 :(得分:0)

您还需要升级Node。

您可以在此处阅读如何更新升级版本:
https://askubuntu.com/questions/426750/how-can-i-update-my-nodejs-to-the-latest-version