Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Why is Node 6.0 a requirement in the docs. #9

Closed
jonnywilliamson opened this issue Aug 28, 2016 · 8 comments
Closed

Why is Node 6.0 a requirement in the docs. #9

jonnywilliamson opened this issue Aug 28, 2016 · 8 comments

Comments

@jonnywilliamson
Copy link
Contributor

Hi,

The docs show a requirement for Node 6

image

However it seems that by using Node 6 we have some other issues when we use gulp (laravel elixir) to generate some of the JS code.

https://github.com/laravel/elixir/issues/496
laravel/elixir#543

I'm experiencing those issues too...

Do we really need Node 6?

@tlaverdure
Copy link
Owner

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

@jonnywilliamson
Copy link
Contributor Author

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.

@jonnywilliamson
Copy link
Contributor Author

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

http://stackoverflow.com/a/34974626

@jonnywilliamson
Copy link
Contributor Author

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

@tlaverdure
Copy link
Owner

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

@jonnywilliamson
Copy link
Contributor Author

jonnywilliamson commented Aug 28, 2016

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

#10

@tlaverdure
Copy link
Owner

Closing and fixing in an upcoming release.

@jonnywilliamson
Copy link
Contributor Author

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!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants