gimm / gulp-live-server

serve your nodejs/static app live
148 stars 71 forks source link

--harmony not working #10

Closed GeoffreyPlitt closed 9 years ago

GeoffreyPlitt commented 9 years ago

I'm on Node 0.12.2 trying to use gls with --harmony

I have a Gulpfile with gls using the "--harmony" flag. I also use the "--harmony" flag when running gulp itself below.

const gulp = require('gulp')
const gls = require('gulp-live-server')

const server = gls.new(['--harmony', 'app.js'])

gulp.task('express', () => {
  server.start()
})

And an app.js:

const express = require('express')
const app = express()
app.use(express.static('frontend'))
const port = process.env.PORT || 3000
const server = app.listen(port, () => {
  const host = server.address().address
  const port = server.address().port
  console.log('App listening at http://localhost:' + port)
})

The app runs fine without Gulp, with --harmony:

$ node --harmony app.js 
App listening at http://localhost:3000

But fails with "[code => 9 | sig => null]" with gls:

DEBUG=* node --harmony ./node_modules/gulp/bin/gulp.js express
[22:36:43] Using gulpfile /vagrant/Gulpfile.js
[22:36:43] Starting 'express'...
  tinylr:server Configuring HTTP server +0ms
[22:36:43] Finished 'express' after 11 ms
livereload[tiny-lr] listening on 35729 ...
  gulp-live-server server process exited with [code => 9 | sig => null] +0ms

Please advise, thanks.

gimm commented 9 years ago

I'll tried the same thing here, works for me. Will keep an eye on this. Thanks for your feedback.

GeoffreyPlitt commented 9 years ago

How can I debug this? Is there a way to see stacktraces? What does code=9 mean?

gimm commented 9 years ago

9 means invalid arguments, check https://nodejs.org/api/process.html#process_exit_codes