• 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
  using node.js on NIOT-E-TP151-EN-RE COswald 9 36 May-20th-2020, 12:54 PM
Last Post: Armin@netPI
  Node-RED log location SteveO 1 5 May-11th-2020, 07:53 PM
Last Post: Armin@netPI
  how to pick up PROFINET data and store them to OPC UA server on Node-RED/netPI. tad 7 38 March-16th-2020, 10:21 AM
Last Post: Armin@netPI
  Node Red stop working DSongra 1 11 February-12th-2020, 08:19 AM
Last Post: Armin@netPI
  After „Rebuild“ of Docker neither the node-RED nor the dashboard can be accessed MAK 4 21 January-31st-2020, 02:14 PM
Last Post: MAK
  How to save node-red flows persistent? hsammer 2 33 November-5th-2019, 03:50 PM
Last Post: hsammer
  [SOLVED] activate LED1/2 with Node-RED + fieldbus nodes container Christian_Rau 6 97 October-21st-2019, 10:30 AM
Last Post: Armin@netPI
  netPI Node-Red fieldbus node Error PersEE 5 69 October-8th-2019, 03:55 PM
Last Post: Armin@netPI
  error when using GPIO from Python dcatteeu 4 17 September-10th-2019, 02:45 PM
Last Post: dcatteeu
  EIP Node Red configurator mnieuzyla 4 34 September-10th-2019, 06:19 AM
Last Post: Armin@netPI

Forum Jump:


Users browsing this thread: 1 Guest(s)