• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error when using a node 'OpcUaServer'
#1
Dear Armin,

This may be a simple question(?)

- Once I removed all containers.
- I just added hilschernetpi/netpi-nodered.

- I used a node 'OpcUa-Server' and then I got an error as attached.

"Error: get-installed-path: module not found "node-opcua-server" in path /usr/lib/node_modules/node-red-contrib-opcua/node-opcua-server"

Note: I found node-opcua-server in /usr/lib/node_modules/node-red-contrib-opcua/node_modules/node-opcua-server.

I created a meaningful data flow, but this error did not still go away.
If you can guess the possible problems, I would appreciate your advice.
Thank you very much for your support.
Best regards,


Attached Files Thumbnail(s)
   
  Reply
#2
I see the same error.

It seems to be a problem also others had in year 2019. See this issue here https://github.com/mikakaraila/node-red-...issues/110.

They are reporting the same issue but with Node-RED version 0.20.3. The problem has been corrected meanwhile in the source code as I read the answer of the developer in the ticket.

Our Node-RED container uses Node-RED in the version 1.0.6 and node.js in the version v12.16.3. Maybe this Node-RED and node.js combo let show the error again. In our container the node-red-contrib-version 0.2.49 is installed by default but also the latest version node-red-contrib-version 0.2.52 shows the same error.

I went into the source code of version 0.2.52. https://github.com/mikakaraila/node-red-...aserver.js in accordance to the issue https://github.com/mikakaraila/node-red-...issues/110 at line 85 to see if the correction was done and I see it was indeed corrected ...


Code:
    var serverPkg = installedPath.getInstalledPathSync('node-opcua-server', {
    paths: [
         path.join(__dirname, '..'),
        path.join(__dirname, '../..'),
         path.join(process.cwd(), './node_modules'),
         path.join(process.cwd(), '.node-red/node_modules'),
     ],
})


I think this needs more investiation. If this is a bug then I have to report this as an issue to the developer

Thx
Armin
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#3
I found the problem. The list of search paths is incomplete in the source code of the OPC-UA node.

I had to install another line in the list of path where the node has to look for the server node.

Code:
var serverPkg = installedPath.getInstalledPathSync('node-opcua-server', {
    paths: [
         path.join(__dirname, '..'),
          path.join(__dirname, '../..'),
         path.join(process.cwd(), './node_modules'),
   --->       path.join(process.cwd(), '../node_modules'), <----
         path.join(process.cwd(), '.node-red/node_modules'),
     ],

Then it works. This is a bug and I have to repot it to the developer and raise an issue.

I cannot solve it myself for everybody sind it is a bug. You can edit the source code yourself in the container.

Thx
Arminn
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#4
Dear Armin,

Thank you very much for your quick investigation/feedback.
I don't have enough knowledge to edit the source code so that I wait for a while.

Best regards,
  Reply
#5
I raised an issue in the source code project https://github.com/mikakaraila/node-red-...issues/148 that describes the problem. I hope it will be corrected soon.

But there is a work around for you meanwhile. You can update the installed version 0.2.49 with the new version 0.2.52 if you use the "manage palette" function in Node-RED top right menu. Enter in "nodes" the term "opcua" and then press update. when it is finished restart the container and then it will work.

Thx
Armin
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#6
I got confirmation from development team that the fix has been applied to the source code already.

But there is no release yet. They want to wait for other bugs and collect before they release a new version.

So we have to wait.

Thx
Armin
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#7
Dear Armin,

I was able to update the node-red-contrib-opcua with the new version 0.2.52 according to your suggestion!
I really appreciate your kind support.

Now my opc-ua server is running without errors so far.

Best regards,
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Node Red configuration LucioFiam 3 1,733 November-30th-2022, 05:14 PM
Last Post: Armin@netPI
  Initial Setup of Control Panel with admin + admin thorws error Michi 4 2,797 January-28th-2022, 09:28 AM
Last Post: Michi
  cannot execute file: Exec format error - NETPI tuliosouza 1 1,786 January-13th-2022, 01:17 PM
Last Post: Armin@netPI
  secure node-red with a username and password Christian_Rau 3 2,942 December-3rd-2021, 11:06 AM
Last Post: Armin@netPI
  cifx0 and Node-Red fabio1975 5 3,199 November-22nd-2021, 01:13 PM
Last Post: Armin@netPI
  netPI opc ua server pull image error wswitula 3 3,182 August-27th-2021, 10:47 AM
Last Post: wswitula
  Node red web UI issue DSongra 3 3,228 July-22nd-2021, 02:47 PM
Last Post: Armin@netPI
  Node-RED 'projects' possible on netPI? JG_KIT 2 2,358 July-20th-2021, 01:11 PM
Last Post: JG_KIT
  Node-RED: OpcUa Client node tad 4 4,505 June-9th-2021, 08:51 AM
Last Post: tad
  Accessing a modbus device connected to RTE port from Node-RED tad 10 8,099 October-2nd-2020, 07:21 AM
Last Post: Armin@netPI

Forum Jump:


Users browsing this thread: 1 Guest(s)