ARI Websocket issues related to wscat

after following all steps described in doc to use ARI, and try to Connect to Asterisk using wscat : wscat -c "ws://localhost:8088/ari/events?api_key=asterisk:asterisk&app=hello-world"
i get this error :
/usr/lib/node_modules/wscat/node_modules/ws/lib/websocket.js:354
…options
^^^

SyntaxError: Unexpected token …
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions…js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object. (/usr/lib/node_modules/wscat/node_modules/ws/index.js:3:19)

Hi, everyone
As you see in the message issues is not coming from asterisk configuration, and it’s related to wscat command, so the solution is to check version of your node and npm to detect that you have old versions by :
npm -v
node -v
then you have to upgrade node version to 14 by following this article Install the latest node version
good luck

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.