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

**URL:** <https://discourse.nodered.org/t/node-red-node-serialport-serialport-error-with-node-v13/24427>\
**Category:** General\
**Created:** [7 April 2020 20:25 UTC](https://discourse.nodered.org/t/node-red-node-serialport-serialport-error-with-node-v13/24427 "2020-04-07T20:25:00Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![hughrobertson44](https://avatars.discourse-cdn.com/v4/letter/h/76d3ee/32.png) [@hughrobertson44](https://discourse.nodered.org/u/hughrobertson44)\
**Post date:** [7 April 2020 20:25 UTC](https://discourse.nodered.org/t/node-red-node-serialport-serialport-error-with-node-v13/24427/1 "2020-04-07T20:25:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 April 2020 21:09 UTC](https://discourse.nodered.org/t/node-red-node-serialport-serialport-error-with-node-v13/24427/2 "2020-04-07T21:09:58Z")

</div>

You would be better to use the [recommended install/update script](https://nodered.org/docs/getting-started/raspberrypi) 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.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [7 April 2020 22:47 UTC](https://discourse.nodered.org/t/node-red-node-serialport-serialport-error-with-node-v13/24427/3 "2020-04-07T22:47:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hughrobertson44](https://avatars.discourse-cdn.com/v4/letter/h/76d3ee/32.png) [@hughrobertson44](https://discourse.nodered.org/u/hughrobertson44)\
**Post date:** [8 April 2020 17:53 UTC](https://discourse.nodered.org/t/node-red-node-serialport-serialport-error-with-node-v13/24427/4 "2020-04-08T17:53:56Z")

</div>

hi I have run rebuild and get errors

[2020-04-08T09\_13\_08\_048Z-debug.txt](https://discourse.nodered.org/uploads/short-url/uiV3T41neYjqO2cqCiPDgFwMN9E.txt) (24.6 KB)

I also initially used the official install script.

Hugh

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [8 April 2020 20:27 UTC](https://discourse.nodered.org/t/node-red-node-serialport-serialport-error-with-node-v13/24427/5 "2020-04-08T20:27:49Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![hughrobertson44](https://avatars.discourse-cdn.com/v4/letter/h/76d3ee/32.png) [@hughrobertson44](https://discourse.nodered.org/u/hughrobertson44)\
**Post date:** [12 April 2020 21:04 UTC](https://discourse.nodered.org/t/node-red-node-serialport-serialport-error-with-node-v13/24427/6 "2020-04-12T21:04:29Z")

</div>

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](https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered))

```auto
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
```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 April 2020 21:33 UTC](https://discourse.nodered.org/t/node-red-node-serialport-serialport-error-with-node-v13/24427/7 "2020-04-12T21:33:06Z")

</div>

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

```auto
sudo npm remove nodejs
sdo npm remove npm

```

and run the script again

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 April 2020 21:35 UTC](https://discourse.nodered.org/t/node-red-node-serialport-serialport-error-with-node-v13/24427/8 "2020-04-12T21:35:36Z")

</div>

> [@hughrobertson44](#):
>
> 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

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.

---

<div class="post-metadata">

**Author:** ![hughrobertson44](https://avatars.discourse-cdn.com/v4/letter/h/76d3ee/32.png) [@hughrobertson44](https://discourse.nodered.org/u/hughrobertson44)\
**Post date:** [12 April 2020 22:25 UTC](https://discourse.nodered.org/t/node-red-node-serialport-serialport-error-with-node-v13/24427/9 "2020-04-12T22:25:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 April 2020 07:52 UTC](https://discourse.nodered.org/t/node-red-node-serialport-serialport-error-with-node-v13/24427/10 "2020-04-13T07:52:56Z")

</div>

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.

> [@hughrobertson44](#):
>
> I have a terminal running on rpi node 12.16.2. and running the serial port node.

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [12 June 2020 07:53 UTC](https://discourse.nodered.org/t/node-red-node-serialport-serialport-error-with-node-v13/24427/11 "2020-06-12T07:53:01Z")

</div>

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