[node-red-node-serialport/serialport] Error with node v13

I have a problem after installing node-red-node-serialport.

After starting node red I get the following message:
7 Apr 20:22:05 - [info] Loading palette nodes
7 Apr 20:22:10 - [warn] ------------------------------------------------------
7 Apr 20:22:10 - [warn] [node-red-node-serialport/serialport] Error: The module '/home/pi/.node-red/node_modules/@serialport/bindings/build/Release/bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 79. 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).
RPI details:
npm -v 6.14.4
node -v v13.11.0
OS
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"

have tried re-compiling or re-installing
the module (for instance, using npm rebuild or npm install). perhaps not correctly.
Installed on main ubuntu machine ok. have deleted and reinstalled npm, node, node-red. so latest of everything. new install of rpi, serial port access ok using other apps.

Any ideas

Thanks Hugh

PS
install Log

2020-04-07T18:20:04.719Z Install : node-red-node-serialport 0.10.1

2020-04-07T18:20:11.445Z [err] npm
2020-04-07T18:20:11.448Z [err]
2020-04-07T18:20:11.449Z [err] WARN npm
2020-04-07T18:20:11.449Z [err] npm does not support Node.js v10.15.2
Node.js is latest 13.11.0 Newly installed as is RPI OS, NPM and node-red.

Serial port works ok with other apps

You would be better to use the recommended install/update script for installing node red, that way you would get a consistent set of tools. Nodejs 13.x is not an LTS version and is not recommended. You should use 10.x or 12.x.

If you run the script now it will probably tidy things up, though it is possible there might be problems running the script, depending on how you have got to the position you are in. I suggest trying it and see what happens.
If you already have a significant set of flows developed then back that up first.

You have to run npm rebuild in your node red user directory. Usually ~/.node-red
But yes node 12 LTS is the version we recommend

hi I have run rebuild and get errors

2020-04-08T09_13_08_048Z-debug.txt (24.6 KB)

I also initially used the official install script.

Hugh

I don't know if it is the issue but did you run
sudo apt install build-essential git
as suggested on the page with the install script.

If it is not that then I think you have to downgrade nodejs from the unsupported version 13 that you currently have.
If you initially ran the upgrade script then how did you get to nodejs 13?

i have just uninstalled node-red on the rpi and deleted anything i could find referencing node-red.
and then ran
sudo apt install build-essential git
and then
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

ran node-red-start and got the following error message

12 Apr 21:48:41 - [warn] [node-red-node-serialport/serialport] Error: The module '/home/pi/.node-red/node_modules/@serialport/bindings/build/Release/bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 79. 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`).
""""terminal displays """"""
  Stop Node-RED                       ✔
  Remove old version of Node-RED      ✔
  Remove old version of Node.js       -
  Leave existing Node.js              -   Node v13.11.0   Npm 6.14.4
  Clean npm cache                     -
  Install Node-RED core               ✔   1.0.4 
  Move global nodes to local          -
  Install extra Pi nodes              ✔
  Npm rebuild existing nodes          -
  Add shortcut commands               ✔

I note that it says 
  Remove old version of Node.js       -
then says
  Leave existing Node.js              -   Node v13.11.0   Npm 6.14.4
  
bit confusing    Is it removing or leaving

I have done the similar on ubuntu systems and had no problems. 
Hugh

You may have removed node-red but you did not remove nodejs, which was the bit that mattered.

sudo npm remove nodejs
sdo npm remove npm

and run the script again

It means that it would remove any nodejs older than 8.x, otherwise it leaves the current version on the assumption that you intentionally installed a later version.

thanks.
I note that node red running under ubuntu has node v 12.16.2
I have a terminal running on rpi node 12.16.2. and running the serial port node.
in the palette it is displaying the serial app with a red triangle so i tried to uninstall it. it came up with an error Failed to remove: node-red-node-serialport I note on the command line on the terminal which node red is running in indicated it had been removed but palette seem to think its there but uninstallable,

So recap
running Node 12.16.2
palette shows serial port installed with red triangle after a remove request (it was there before request)
command line indicated it was removed.
palette will not allow removal.
modules not now in /home/pi/.node-red/node_modules so have been removed but palette does not recognise that

Log shows

2020-04-12T22:23:57.826Z Remove : node-red-node-serialport

all a bit iffy

hugh

Is this after running the upgrade script? You haven't made that clear.
If you removed the serial port using the command line then you must restart node-red so that node-red will pick up the fact that it has been removed.

I don't understand what you mean by a terminal running the serial port node.

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