# Module did not self-register @serialport

**URL:** <https://discourse.nodered.org/t/module-did-not-self-register-serialport/74027>\
**Category:** General\
**Tags:** modbus\
**Created:** [22 January 2023 00:23 UTC](https://discourse.nodered.org/t/module-did-not-self-register-serialport/74027 "2023-01-22T00:23:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![leifnel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/leifnel/32/3053_2.png) [@leifnel](https://discourse.nodered.org/u/leifnel)\
**Post date:** [22 January 2023 00:23 UTC](https://discourse.nodered.org/t/module-did-not-self-register-serialport/74027/1 "2023-01-22T00:23:59Z")

</div>

I had to reinstall my raspberry pi zero

I copied the old ~/.node-red to the new, and then ran the update-script.  
So I have the same flows as before.

I get this in the log:  
foo - Error: Module did not self-register: '/home/pi/.node-red/node\_modules/@serialport/bindings/build/Release/bindings.node'.

I'm using  
node-red-contrib-serial-modbus v 0.0.11 to read my power-meter.  
I can see in /dev/ that the usb modbus adapter appears when I plug it in, but I get no results from the power-meter.

Is modbus related to @serialport?

---

<div class="post-metadata">

**Author:** ![leifnel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/leifnel/32/3053_2.png) [@leifnel](https://discourse.nodered.org/u/leifnel)\
**Post date:** [22 January 2023 00:56 UTC](https://discourse.nodered.org/t/module-did-not-self-register-serialport/74027/2 "2023-01-22T00:56:45Z")

</div>

Is there a way to see if the modbus is being polled?

---

<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:** [22 January 2023 07:55 UTC](https://discourse.nodered.org/t/module-did-not-self-register-serialport/74027/3 "2023-01-22T07:55:37Z")

</div>

You should not have copied the .node-red/node\_modules folder. Delete that folder, go into the .node-red folder, and run  
`npm install`  
Which will reinstall all additional nodes required.

Edit: Note that this may take quite a long time on a zero.

---

<div class="post-metadata">

**Author:** ![leifnel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/leifnel/32/3053_2.png) [@leifnel](https://discourse.nodered.org/u/leifnel)\
**Post date:** [22 January 2023 10:48 UTC](https://discourse.nodered.org/t/module-did-not-self-register-serialport/74027/4 "2023-01-22T10:48:45Z")

</div>

npm install dies on serialport

```auto
284 verbose pkgid @serialport/bindings@2.0.8
285 verbose cwd /home/pi/.node-red
286 verbose Linux 5.15.61+
287 verbose node v16.19.0
288 verbose npm v8.19.3
289 error code 1
290 error path /home/pi/.node-red/node_modules/serialport/node_modules/@serialport/bindings
291 error command failed
292 error command sh -c -- prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
293 error make: Entering directory '/home/pi/.node-red/node_modules/serialport/node_modules/@serialport/bindings/build'
293 error CXX(target) Release/obj.target/bindings/src/serialport.o
293 error make: Leaving directory '/home/pi/.node-red/node_modules/serialport/node_modules/@serialport/bindings/build'
294 error gyp info it worked if it ends with ok
294 error gyp info using node-gyp@9.1.0
294 error gyp info using node@16.19.0 | linux | arm
294 error gyp info find Python using Python version 3.9.2 found at "/usr/bin/python3"
294 error gyp info spawn /usr/bin/python3
294 error gyp info spawn args [
294 error gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
294 error gyp info spawn args 'binding.gyp',
294 error gyp info spawn args '-f',
294 error gyp info spawn args 'make',
294 error gyp info spawn args '-I',
294 error gyp info spawn args '/home/pi/.node-red/node_modules/serialport/node_modules/@serialport/bindings/build/config.gypi',
294 error gyp info spawn args '-I',
294 error gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
294 error gyp info spawn args '-I',
294 error gyp info spawn args '/home/pi/.cache/node-gyp/16.19.0/include/node/common.gypi',
294 error gyp info spawn args '-Dlibrary=shared_library',
294 error gyp info spawn args '-Dvisibility=default',
294 error gyp info spawn args '-Dnode_root_dir=/home/pi/.cache/node-gyp/16.19.0',
294 error gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
294 error gyp info spawn args '-Dnode_lib_file=/home/pi/.cache/node-gyp/16.19.0/<(target_arch)/node.lib',
294 error gyp info spawn args '-Dmodule_root_dir=/home/pi/.node-red/node_modules/serialport/node_modules/@serialport/bindings',

```

---

<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:** [22 January 2023 11:16 UTC](https://discourse.nodered.org/t/module-did-not-self-register-serialport/74027/5 "2023-01-22T11:16:53Z")

</div>

Post the full output please.

Did you install build-essential?

---

<div class="post-metadata">

**Author:** ![leifnel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/leifnel/32/3053_2.png) [@leifnel](https://discourse.nodered.org/u/leifnel)\
**Post date:** [22 January 2023 11:50 UTC](https://discourse.nodered.org/t/module-did-not-self-register-serialport/74027/6 "2023-01-22T11:50:35Z")

</div>

I did a npm install serialport in ~pi

then I could do a npm install in ~pi/nodered, and it's working now.

---

<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:** [23 January 2023 20:59 UTC](https://discourse.nodered.org/t/module-did-not-self-register-serialport/74027/7 "2023-01-23T20:59:35Z")

</div>

> [@leifnel](#):
>
> I did a npm install serialport in ~pi

That would not have made any difference. All it will have done is to install it into ~/node\_modules and created package files in ~

---

<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:** [6 February 2023 20:59 UTC](https://discourse.nodered.org/t/module-did-not-self-register-serialport/74027/8 "2023-02-06T20:59:38Z")

</div>

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