Search code examples
node.jssonos

Sonos Simulator not able to compile node package


Trying to install and utilize the https://developer.sonos.com/tools/developer-tools/sonos-simulator/

When following the install instructions and trying to install the node package via the npm install command within the directory it fails with a 404 error trying to find node-ssdp as seen from the snippet below:

P:\sonosDevel\sonos-simulator-0.4.34>npm install
npm notice
npm notice New minor version of npm available! 7.5.1 -> 7.6.3
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.6.3
npm notice Run npm install -g [email protected] to update!
npm notice
npm ERR! code E404
npm ERR! 404 Not Found - GET https://github.com/sonos/node-ssdp/archive/master.tar.gz
npm ERR! 404
npm ERR! 404  'node-ssdp@https://github.com/sonos/node-ssdp/archive/master.tar.gz' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\duart\AppData\Local\npm-cache\_logs\2021-03-18T21_59_44_515Z-debug.log

I am doubtful there is much to do other than hope the sonos developers reupload the package and potentially update the Sonos Simulator but I may as well throw it on here to see if anyone has a solution to have get the Simulator running or perhaps some other solution to simulate a Sonos Device on the network without actually owning a Sonos device.


Solution

  • I was having a play around with this today, and managed to get it working.

    I installed an old (4.x) version of node as this is what the documentation said it worked with (I honestly didn't try anything newer as I couldn't get the simulator to do what I wanted so uninstalled it after).

    The main issue was with node-ssdp, as the included package file with the simulator was trying to get it from a repo that no longer exists. After some trial and error, I found that if you edit the package file to specify node-ssdp 2.7.0 (which is the version that was released when the simulator was), the npm install should go through ok. (If you install a newer version the simulator crashes a few seconds after you run it).

    Hopefully this helps!