Open cosmicparadox11 opened 3 years ago
This seems to be an error related to playing the notification sound when a slot is found. Can you trying running the script from Command Prompt instead of Powershell just to see if that's the cause of the issue.
i am running it on an ubuntu terminal
Have you changed any code related to sound notification ? You could for the time being comment out the lines which play the notification sound and this should work.
i haven't made any changes
Are you still getting this error, I kept this issue open to see if any other users face this same issue.
I have released new versions of the library so you could try running the latest versions and see if it fixes the issue you had.
still getting the same error
This error is in the latest version too.
Stopping Pinger... (node:16758) UnhandledPromiseRejectionWarning: Error: Command failed: powershell -c Add-Type -AssemblyName presentationCore; $player = New-Object system.windows.media.mediaplayer; $player.open('/home/bhartendu/.npm/_npx/16758/lib/node_modules/cowin-pinger/sounds/beep.wav'); $player.Volume = 0.5; $player.Play(); Start-Sleep 1; Start-Sleep -s $player.NaturalDuration.TimeSpan.TotalSeconds;Exit; /bin/sh: 1: Syntax error: word unexpected (expecting ")")
at ChildProcess.exithandler (child_process.js:294:12)
at ChildProcess.emit (events.js:189:13)
at maybeClose (internal/child_process.js:970:16)
at Socket.stream.socket.on (internal/child_process.js:389:11)
at Socket.emit (events.js:189:13)
at Pipe._handle.close (net.js:600:12)
(node:16758) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch
Can you clone the code and comment out these lines in the code
const sound = require("sound-play");
const path = require("path");
const notificationSound = path.join(__dirname, "sounds/beep.wav");
sound.play(notificationSound);
sound.play(notificationSound, 1);
Now try running npm i
and then node app.js run --age=...
The issue is happening because sound-play doesn't support Ubuntu / Linux-based OS.
@abhinavdc I checked out node-wav-player. It is working fine on Ubuntu and Windows. Need to test it with macOS.
If you think it is worth upgrading, then I can work out the changes. Let me know!!
Usage:
const sound = require('node-wav-player');
sound.play({path: 'notificationSound'});
UnhandledPromiseRejectionWarning: Error: Command failed: powershell -c Add-Type -AssemblyName presentationCore; $player = New-Object system.windows.media.mediaplayer; $player.open('/home/sampath/.npm/_npx/1034/lib/node_modules/cowin-pinger/sounds/beep.mp3'); $player.Volume = 0.5; $player.Play(); Start-Sleep 1; Start-Sleep -s $player.NaturalDuration.TimeSpan.TotalSeconds;Exit; /bin/sh: 1: Syntax error: word unexpected (expecting ")")