GithubHelp home page GithubHelp logo

Comments (8)

tlaverdure avatar tlaverdure commented on June 21, 2024

I'm not entirely sure if Node 6 is a "requirement".

That is all I've tested with so far. If you can test with a lower version please let me know. Thanks

from laravel-echo-server.

jonnywilliamson avatar jonnywilliamson commented on June 21, 2024

Hi,

So I updated to version 0.9.65 that you released a few hours ago.

Then I downgraded to Node 5.12.0 because of the errors using Gulp etc and that sorted those issues out with Laravel-Elixir etc.

However when I restarted my server.js i kept getting this:

node server.js
/home/vagrant/Code/new.mydomain.com/node_modules/laravel-echo-server/dist/echo-server.js:159
    emitPresenceEvents(socket, channel, members, member, action = null) {
                                                                ^

SyntaxError: Unexpected token =
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/vagrant/Code/new.mydomain.com/node_modules/laravel-echo-server/dist/index.js:2:23)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)

So I thought maybe it was because I was using your new release. SO I downgraded that to 0.9.5 (which was working yesterday).

No joy, kept getting this message:

node server.js
/home/vagrant/Code/new.mydomain.com/node_modules/laravel-echo-server/dist/echo-server.js:122
    emitPresenceEvents(socket, channel, members, member, action = null) {
                                                                ^

SyntaxError: Unexpected token =
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/vagrant/Code/new.mydomain.com/node_modules/laravel-echo-server/dist/index.js:2:23)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)

Finally upgraded back to Node 6, and it started working again.

node server.js
EchoServer: "Servering at http://new.<mydomain>.dev:6001"

So it appears that node 6 is required.

Would you be able to see/understand why it is needed? Would it be a massive or difficult task to make this package Node 5 compatible too?

Thank you kindly as I have very very much out of my depth with the javascript package world.

from laravel-echo-server.

jonnywilliamson avatar jonnywilliamson commented on June 21, 2024

Changing between node versions, I used the info I got from here.

http://stackoverflow.com/a/34974626

from laravel-echo-server.

jonnywilliamson avatar jonnywilliamson commented on June 21, 2024

So it looks like because you are using default parameter values which is a new feature in JS and so only works in Node v6?

I think there is a simple work around to this: http://www.codereadability.com/javascript-default-parameters-with-or-operator/ (Paragraph starting with: How to set defaults values instead)

I have just edited the echo-server.js file and I appear to have it working on Node 5+

Standby

from laravel-echo-server.

tlaverdure avatar tlaverdure commented on June 21, 2024

Ah yes, that is probably why. I'll make that update when I get a chance.

from laravel-echo-server.

jonnywilliamson avatar jonnywilliamson commented on June 21, 2024

You'll know much better than me, but here's what I did to make it work.

#10

from laravel-echo-server.

tlaverdure avatar tlaverdure commented on June 21, 2024

Closing and fixing in an upcoming release.

from laravel-echo-server.

jonnywilliamson avatar jonnywilliamson commented on June 21, 2024

Thanks very much.

I think node 5 is what is installed as default on homestead and whilst it isn't difficult to upgrade node, it might help stop a lot of support issues if it was compatible with the version that comes as default.

Also I think node 4.xx is the LTS version at the moment too. I haven't done any testing with that, but if your lucky you might be able to support that version too!!

from laravel-echo-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.