Plexamp for Raspberry Pi - Node incompatibility

Hi there

I have got one install of Plexamp for Pi headless working, however I have come to build another and am struggling. I think that the repos with Node in have moved along and we need a recompile of the client.

I am using the latest and greatest raspbian (buster) and following the instructions, it appears that everything works, however when I come to run it it doesn’t register with the server.

using

sudo systemctl status plexamp 

I can see that the service continually restarts as the Active line shows that it never runs for longer than a few seconds

To debug this, I have run it at the command line, using

/usr/bin/node /home/pi/plexamp/server/server.prod.js

It throws an error and gives the following info:

/home/pi/plexamp/server/node_modules/bindings/bindings.js:83
        throw e
        ^

Error: The module '/home/pi/plexamp/server/node_modules/serialport/build/Release/serialport.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 59. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:718:18)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at bindings (/home/pi/plexamp/server/node_modules/bindings/bindings.js:76:44)
    at Object.<anonymous> (/home/pi/plexamp/server/node_modules/serialport/lib/bindings.js:3:35)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)

I have run out of skill to correct this, but if it is happening to me, then I am not going to be the only one …

Any chance of some guidance or a new release?

Thanks

Tim

OK - I have fixed it, and so I will share what worked for me so that others might also be able to fix it. Having reached a point where it didn’t work, and having worked out that it was a node version issue, the right thing to do is to try and get the right version of node on the pi …

To do this, I cleaned up and installed binaries of the right version direct from the nodejs.org website …

Stop the plexamp service

sudo systemctl stop plexamp

Uninstalling node

I tried lots of things, and ended up with a bit of a mess that I had to clean up. In short I removed it using instructions that I found here

This will delete any of the installs from the repos.

sudo apt-get remove nodejs

sudo apt-get purge nodejs

sudo apt-get autoremove

If you try any manual installs using npm or nvm then you will have more work to do …

Installing node from nodejs.org

Open the Nodejs website in a browser.

Follow the link for Other Downloads from the front page

Towards the bottom, you will find the link for Previous Releases.

It took me to https://nodejs.org/en/download/releases/

Here you can see all the different versions that you might want. We are looking for a version 9. I followed the link marked Downloads for v9.11.2 which was the last v9 release.

This pulls up a big list of files. You are looking for the one that suits your pi.

Do a quick

uname -a

In the result it shows you what

Linux blackpi 4.19.50-v7+ #896 SMP Thu Jun 20 16:11:44 BST 2019 armv7l GNU/Linux

In this case armv71 - hence the file I want is named node-v9.11.2-linux-armv7l.tar.gz

So back to your terminal session on your pi …

#download the file
wget https://nodejs.org/download/release/v9.11.2/node-v9.11.2-linux-armv7l.tar.gz

#create an install area and extract
sudo mkdir -p /usr/local/lib/nodejs
sudo tar -xJvf node-v9.11.2-linux-armv7l.tar.gz -C /usr/local/lib/nodejs

#set a couple of env variables 
VERSION=v9.11.2
DISTRO=arm71

#make the system wide links
sudo ln -s /usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin/node /usr/bin/node
sudo ln -s /usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin/npm /usr/bin/npm
sudo ln -s /usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin/npx /usr/bin/npx

#check that the versions at a system level are right
node -v
npm version
npx -v

(based on the official instructions from the Nodejs site found from the download page entitled Installing Node.js via binary archive on Linux )

This should give you a working node installation.

Starting plexamp again

sudo systemctl start plexamp

#Now check whether your plexamp is working
sudo systemctl status plexamp -n 50

If you still have an error, check you have copied over your server.json correctly. One mistake I made which took some time to spot was creating

~pi/.config/plexamp/server.json

when it should have been

~pi/.config/Plexamp/server.json

This stops it working.

Assuming you get everything right, then the player will connect to the server and sweet music will come out of the headphone socket.

One more tip …

Adjust the volume in alsamixer to increase the volume

This implies a node mismatch. Per Plexamp for Raspberry Pi Release Notes you need Node 9.

I’m getting this error when I connect with my mobile app to the plexamp pi

Jul 10 06:17:02 raspberrypi node[507]: error: [ERROR] TypeError: path must be absolute or specify root to res.sendFile
Jul 10 06:17:02 raspberrypi node[507]:     at ServerResponse.L.sendFile (/home/pi/plexamp/server/server.prod.js:1:1199278)
Jul 10 06:17:02 raspberrypi node[507]:     at expressApp.get (/home/pi/plexamp/server/server.prod.js:1:741187)
Jul 10 06:17:02 raspberrypi node[507]:     at r.handle_request (/home/pi/plexamp/server/server.prod.js:1:1208804)
Jul 10 06:17:02 raspberrypi node[507]:     at r (/home/pi/plexamp/server/server.prod.js:1:1210231)
Jul 10 06:17:02 raspberrypi node[507]:     at r.dispatch (/home/pi/plexamp/server/server.prod.js:1:1210390)
Jul 10 06:17:02 raspberrypi node[507]:     at r.handle_request (/home/pi/plexamp/server/server.prod.js:1:1208804)
Jul 10 06:17:02 raspberrypi node[507]:     at /home/pi/plexamp/server/server.prod.js:1:1205075
Jul 10 06:17:02 raspberrypi node[507]:     at s (/home/pi/plexamp/server/server.prod.js:1:1206536)
Jul 10 06:17:02 raspberrypi node[507]:     at s (/home/pi/plexamp/server/server.prod.js:1:1206730)
Jul 10 06:17:02 raspberrypi node[507]:     at Function.f.process_params (/home/pi/plexamp/server/server.prod.js:1:1206953)
Jul 10 06:17:02 raspberrypi node[507]:     at r (/home/pi/plexamp/server/server.prod.js:1:1205019)
Jul 10 06:17:02 raspberrypi node[507]:     at /home/pi/plexamp/server/server.prod.js:1:1206027
Jul 10 06:17:02 raspberrypi node[507]:     at r (/home/pi/plexamp/server/server.prod.js:1:1204736)
Jul 10 06:17:02 raspberrypi node[507]:     at Function.f.handle (/home/pi/plexamp/server/server.prod.js:1:1206454)
Jul 10 06:17:02 raspberrypi node[507]:     at t (/home/pi/plexamp/server/server.prod.js:1:1203430)
Jul 10 06:17:02 raspberrypi node[507]:     at r.handle_request (/home/pi/plexamp/server/server.prod.js:1:1208804)
Jul 10 06:17:02 raspberrypi node[507]:     at /home/pi/plexamp/server/server.prod.js:1:1205447
Jul 10 06:17:02 raspberrypi node[507]:     at /home/pi/plexamp/server/server.prod.js:1:1205469
Jul 10 06:17:02 raspberrypi node[507]:     at Function.f.process_params (/home/pi/plexamp/server/server.prod.js:1:1206927)
Jul 10 06:17:02 raspberrypi node[507]:     at r (/home/pi/plexamp/server/server.prod.js:1:1205019)
Jul 10 06:17:02 raspberrypi node[507]:     at /home/pi/plexamp/server/server.prod.js:1:1206027
Jul 10 06:17:02 raspberrypi node[507]:     at r (/home/pi/plexamp/server/server.prod.js:1:1204736)

Shouldn’t this be: DISTRO=linux-armv71

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