question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MODULE_NOT_FOUND on Node-Red 2.2.0 with library version 5.21.0

See original GitHub issue

Problem

  • (X) bug report => please search github for a similar issue or PR and test Modbus problems with the modbus-serial package before submitting
  • ( ) unexpected behavior => please visit the Wiki before

Current behavior After updating Node-RED to version 2.2.0 in Home Assistant, the module seems to be broken: all the modules report as “MODULE_NOT_FOUND”.

Expected behavior

Minimal reproduction of the problem with instructions

  1. Installed latest version of Home Assistant
  2. Installed the Node-Red addon, which installs Node-Red 2.2.0 with the latest nodered-contrib-modbus (5.21.0)
  3. The module won’t work straight out of the box

Your Environment

Please tell us about your environment:

  • (X) I am using just the Node-RED package and got modbus-serial package installed with it
  • ( ) I have installed modbus-serial package global from source (using git clone)
  • ( ) I have installed modbus-serial as a global package (using npm i -g)

Yes, modbus-serial is the name but it does all, TCP and Serial. The node-modbus package is just for the Modbus Server node.

  • Device :

    • ( ) macOS: v
    • (X) Linux: v
    • ( ) Windows: v
    • (X) Raspbian: v
    • ( ) Other:
      • Name:
      • Version:
  • Description of the connecting Modbus system:

    • Name :
    • Version:
    • Vendor :
    • Link : https://
  • node-red-contrib-modbus version: v5.21.0

  • Node: (v14.x) node --version = vX.X.X

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
a-n-lundgrencommented, Feb 14, 2022

Added “source-map-support” to the npm_packages configuration parameter, then got this:

15 Feb 00:01:13 - [warn] [node-red-contrib-modbus/Modbus-Flex-Sequencer] Error: Cannot find module ‘line-by-line’ Require stack:

  • /opt/node_modules/node-red-contrib-modbus/modbus/core/modbus-io-core.js
  • /opt/node_modules/node-red-contrib-modbus/modbus/modbus-flex-sequencer.js
  • /opt/node_modules/@node-red/registry/lib/loader.js
  • /opt/node_modules/@node-red/registry/lib/index.js
  • /opt/node_modules/@node-red/runtime/lib/nodes/index.js
  • /opt/node_modules/@node-red/runtime/lib/index.js
  • /opt/node_modules/node-red/lib/red.js
  • /opt/node_modules/node-red/red.js

Added line-by-line and everything seems to work. Final configuration that works for me:

npm_packages:
  - source-map-support
  - line-by-line

0reactions
biancodecommented, Feb 15, 2022

I had this packages global and did not see the problem in the test environment. Fixed with V5.21.2.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't find module after install (any module) - Node-RED Forum
The problem happens with any module, not only with 'node-red-contrib-s7'. So the problem is, when I install a package from terminal (being inside...
Read more >
Version 2.0 released - Node-RED
The main focus of this release has been dropping support for old versions of Node.js that are themselves no longer supported.
Read more >
Supported Node versions - Node-RED
We try to stay up to date with Node.js releases. Our goal is to support the Maintenance and Active LTS releases. We do...
Read more >
Version 2.2 released - Node-RED
Version 2.2 released. 27 January 2022 • Nick O'Leary. Node-RED 2.2 is now available to install. If upgrading, please read the upgrade instructions....
Read more >
Installing a module fails to install dependencies?
I'm having difficulties with NPM dependency installation. It's not happening the way I would hope it would... Specifically: node-red-fd-corewidgets depends ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found