jishi / node-sonos-web-controller

A web based controller for Sonos utilizing web sockets for a native look and feel
MIT License
247 stars 45 forks source link

Getting error when commanding node server.js #70

Closed sw764206 closed 4 years ago

sw764206 commented 4 years ago

Im getting the error below when initializing node server.js

node server.js no settings file found, will only use default settings /volume1/homes/admin/sonosweb/node_modules/socket.io/node_modules/ws/lib/websocket.js:348 ...options ^^^

SyntaxError: Unexpected token ... at createScript (vm.js:56:10) at Object.runInThisContext (vm.js:97:10) at Module._compile (module.js:542:28) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object. (/volume1/homes/admin/sonosweb/node_modules/socket.io/node_modules/ws/index.js:3:19)

sw764206 commented 4 years ago

and now im getting this error 0 info it worked if it ends with ok 1 verbose cli [ '/volume1/@appstore/Node.js_v6/usr/local/bin/node', 1 verbose cli '/usr/local/bin/npm', 1 verbose cli 'start' ] 2 info using npm@3.10.10 3 info using node@v6.12.3 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle sonos-web-controller@0.14.0~prestart: sonos-web-controller@0.14.0 6 silly lifecycle sonos-web-controller@0.14.0~prestart: no script for prestart, continuing 7 info lifecycle sonos-web-controller@0.14.0~start: sonos-web-controller@0.14.0 8 verbose lifecycle sonos-web-controller@0.14.0~start: unsafe-perm in lifecycle true 9 verbose lifecycle sonos-web-controller@0.14.0~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/volume1/homes/admin/websonos/node_modules/.bin:/volume1/@appstore/Node.js_v6/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin 10 verbose lifecycle sonos-web-controller@0.14.0~start: CWD: /volume1/homes/admin/websonos 11 silly lifecycle sonos-web-controller@0.14.0~start: Args: [ '-c', 'node server.js' ] 12 silly lifecycle sonos-web-controller@0.14.0~start: Returned: code: 1 signal: null 13 info lifecycle sonos-web-controller@0.14.0~start: Failed to exec start script 14 verbose stack Error: sonos-web-controller@0.14.0 start: node server.js 14 verbose stack Exit status 1 14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:255:16) 14 verbose stack at emitTwo (events.js:106:13) 14 verbose stack at EventEmitter.emit (events.js:191:7) 14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14) 14 verbose stack at emitTwo (events.js:106:13) 14 verbose stack at ChildProcess.emit (events.js:191:7) 14 verbose stack at maybeClose (internal/child_process.js:920:16) 14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5) 15 verbose pkgid sonos-web-controller@0.14.0 16 verbose cwd /volume1/homes/admin/websonos 17 error Linux 3.10.105 18 error argv "/volume1/@appstore/Node.js_v6/usr/local/bin/node" "/usr/local/bin/npm" "start" 19 error node v6.12.3 20 error npm v3.10.10 21 error code ELIFECYCLE 22 error sonos-web-controller@0.14.0 start: node server.js 22 error Exit status 1 23 error Failed at the sonos-web-controller@0.14.0 start script 'node server.js'. 23 error Make sure you have the latest version of node.js and npm installed. 23 error If you do, this is most likely a problem with the sonos-web-controller package, 23 error not with npm itself. 23 error Tell the author that this fails on your system: 23 error node server.js 23 error You can get information on how to open an issue for this project with: 23 error npm bugs sonos-web-controller 23 error Or if that isn't available, you can get their info via: 23 error npm owner ls sonos-web-controller 23 error There is likely additional logging output above. 24 verbose exit [ 1, true ]

jishi commented 4 years ago

Looks like the version of socket.io library that got installed doesn't work with node v6 and requires a newer version. You could try and pin an older version of socket.io through package.json or install an older version manually with npm install.

Just a heads up, it's very likely that Sonos S2 update that will be released in June will break this software.

On Sun, 10 May 2020, 06:14 sw764206, notifications@github.com wrote:

Im getting the error below when initializing node server.js

node server.js no settings file found, will only use default settings /volume1/homes/admin/sonosweb/node_modules/ socket.io/node_modules/ws/lib/websocket.js:348 ...options ^^^

SyntaxError: Unexpected token ... at createScript (vm.js:56:10) at Object.runInThisContext (vm.js:97:10) at Module._compile (module.js:542:28) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object. (/volume1/homes/admin/sonosweb/node_modules/ socket.io/node_modules/ws/index.js:3:19)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jishi/node-sonos-web-controller/issues/70, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYE2I4IW7SNIBMWNXFXK3TRQYS3RANCNFSM4M5CPCCA .

sw764206 commented 4 years ago

Thank for your the response! Argh! That sucks I was so excited to get this controller on my home tablets. I think the same is for your HTTP controller correct?

sw764206 commented 4 years ago

Also will you be planning on updating your http api and this web controller scripts after S2 is released? Or are you planning on retiring them?

I figured i could use them now and disable automatic updates on my system until a new version that works with S2 is released

jishi commented 4 years ago

Seems like I did an upgrade of socket.io to 2.x.x at some point, which probably lost compatibility with node 6.x.

I have upgraded twice, once from 0.9.x to 1.4.5+ and then 2.2.0, but I'm unsure which one broke node 6 compatibility. socket.io doesn't say in their release notes, probably because it is some dependency that is actually the culprit.

Try installing a specific version with: npm install socket.io@1.7.4 (it might even work with 2.0.4, I think it broke in 2.1.0 when they switched websocket library), or even older, like 0.9.19. I think it should be backward-compatible.

jishi commented 4 years ago

Since I haven't gotten any info about S2 nor what it's about, I can't say if I will make a new version that works with S2. The reason I'm suspecting that S2 will break this is because I know that they have been working on cloud-control and have had limited features available through cloud-control. With that in place, I believe that the UPnP api will be obsoleted, and I also think this is what all the fuzz about not being able to make gen1 and gen2 players to work together is about.

With a cloud-control API, most of this will be much easier to implement, but you will still have quite the struggle to use the cloud api with home automation because of authentication etc. There might still be room for similar software, but then I assume it would be a cloud-service that just simplifies the API, and just use static URL tokens (like my bronos solution, http://www.bronos.net/).

We'll see in June what they actually release :)

sw764206 commented 4 years ago

Thank you Jimmy! I had socket 2.something and reverted to 1.7.4 and was able to get the application running. The drag and drop zone feature works great on the computer and even on my iPad but for some reason doesn’t work on an amazon fire tablet. I thought it might be a browser issue so I tried chrome on the device but it still didn’t work. Is this a amazon fire issue? I did try your /m dashboard and it works great for volumes but cant control zones


Albert N. Ahumada Operations Associate Lead McDonald’s USA LLC C: 512-221-6822 | E: albert.ahumada@us.mcd.commailto:albert.ahumada@us.mcd.com

From: Jimmy Shimizu notifications@github.com Reply-To: jishi/node-sonos-web-controller reply@reply.github.com Date: Monday, May 11, 2020 at 7:20 AM To: jishi/node-sonos-web-controller node-sonos-web-controller@noreply.github.com Cc: Albert Ahumada Albert.Ahumada@us.mcd.com, Author author@noreply.github.com Subject: Re: [jishi/node-sonos-web-controller] Getting error when commanding node server.js (#70)

Seems like I did an upgrade of socket.io to 2.x.x at some point, which probably lost compatibility with node 6.x.

I have upgraded twice, once from 0.9.x to 1.4.5+ and then 2.2.0, but I'm unsure which one broke node 6 compatibility. socket.io doesn't say in their release notes, probably because it is some dependency that is actually the culprit.

Try installing a specific version with: npm install socket.io@1.7.4 (it might even work with 2.0.4, I think it broke in 2.1.0 when they switched websocket library), or even older, like 0.9.19. I think it should be backward-compatible.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/jishi/node-sonos-web-controller/issues/70*issuecomment-626666978__;Iw!!JZ0iVwK7KX4!RZ2m78ATUmzQ1xntt-DKMZAAbb-DGY_p9A4tG0azyxG72yLuxJVFVk8q4d1UINEnXtE$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/APP2ZWYMJZWZXDTEA5CXFFDRQ7UP7ANCNFSM4M5CPCCA__;!!JZ0iVwK7KX4!RZ2m78ATUmzQ1xntt-DKMZAAbb-DGY_p9A4tG0azyxG72yLuxJVFVk8q4d1Ujzdlr7s$.


The information contained in this e-mail and any accompanying documents is confidential, may be privileged, and is intended solely for the person and/or entity to whom it is addressed (i.e. those identified in the "To" and "cc" box). They are the property of McDonald's Corporation. Unauthorized review, use, disclosure, or copying of this communication, or any part thereof, is strictly prohibited and may be unlawful. If you have received this e-mail in error, please return the e-mail and attachments to the sender and delete the e-mail and attachments and any copy from your system. McDonald's thanks you for your cooperation.