mikakaraila / node-red-contrib-opcua

A Node-RED node to communicate OPC UA. Uses node-opcua library.
Other
214 stars 197 forks source link

node-opcua-client - 0.2.78 - Error: get-installed-path: module not found #193

Closed apfelsaft87 closed 4 years ago

apfelsaft87 commented 4 years ago

I am using node-opcua-client node of 0.2.78 and I always get this message:

"Error: get-installed-path: module not found "node-opcua-client" in path /usr/local/addons/redmatic/var/node_modules/node-red-contrib-opcua/node-opcua-client"

Can someone help me?

Thanks in advance!

mikakaraila commented 4 years ago

Hmm, your path seems to be different than standard node-red installation. Most probably it can cause error. Have tried to install this manually? "get-installed-path": "^4.0.8",

apfelsaft87 commented 4 years ago

It is a redmatic installation on a CCU3. I've tried to install with npm i get-installed-path but

Unhandled rejection Error: EROFS: read-only file system, mkdir '/root/.npm'0846

┌───────────────────────────────────────────────────┐
│              npm update check failed              │
│        Try running with sudo or get access        │
│       to the local update config store via        │
│ sudo chown -R $USER:$(id -gn $USER) /root/.config │
└───────────────────────────────────────────────────┘
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

The opc-ua-browser node works fine but not opc-ua-client node

mikakaraila commented 4 years ago

Hmm, it is different also other ways. Did you try to install from command line with sudo ?

apfelsaft87 commented 4 years ago

Sure but

-sh: sudo: not found

But I am already logged in as root

mikakaraila commented 4 years ago

Read installation from the command line.

Ich glaube kein probleme mit diese zu folgen: https://github.com/rdmtc/RedMatic/wiki/Node-Installation#installation-via-npm-auf-der-kommandozeile

apfelsaft87 commented 4 years ago

Thank you but it also failed.

I've installed node-red-contrib-opcua and "get-installed-path": "^4.0.8" using that instruction. But still getting the message mentioned in the first posting.

mikakaraila commented 4 years ago

Let´s start again, please run "node-red -v flowfile.json" to see verbose log.

mikakaraila commented 4 years ago

This will be problematic to support as it is not "normal" node-red and needs something special... sorry.

maiholds commented 4 years ago

I got the same issue.

Would it be possible to make this node-pack work for RedMatic?

Thanks in advance for the info!

mikakaraila commented 4 years ago

Can you install get-installed-path to normal npm global registry?

Problem lies in not standard npm installation path, get-installed-path works:

Get installation path where the given package is installed. Works for globally and locally installed packages

RedMatic seems to use this one:

/usr/local/addons/redmatic/var/node_modules/

maiholds commented 4 years ago

I tried to install the pack via the consol. The issue is, that i have no raspian/depian os. So the consol commands are not working.

I am trying to use the opcua pack on a homematic IP CCU3. To install additional software on the CCU i need to use special addons which are only available for the ccu. Therefore i am not using the stanard NodeRed but instead RedMatic which is an addon for the ccu.

So it seams like i am not able to use the opc ua pack unless it can support different install directories.

mikakaraila commented 4 years ago

Ok I can try to add that addon directory to search path

mikakaraila commented 4 years ago

I have this change coming, can you test it before I will publish this?

// Check finally local installation
    if (clientPkg == null) {
      clientPkg = installedPath.getInstalledPathSync('node-opcua-client', {
        paths: [
        path.join(__dirname, '..'),
        path.join(__dirname, '../..'),
        path.join(process.cwd(), './node_modules'),
        path.join(process.cwd(), '../node_modules'), // Linux installation needs this
        path.join(process.cwd(), '.node-red/node_modules'),
        "/usr/local/addons/redmatic/var/node_modules" // Red-matic package installation folder
        ],
      });
      verbose_log("Found locally installed path: " + clientPkg);
    }
mikakaraila commented 4 years ago

I added this to 0.2.86 test with it.

maiholds commented 4 years ago

I tried to install it but it seams to get stuck somehow in the install screen like this: 2020-09-30 20_54_55-Window Install

mikakaraila commented 4 years ago

Enough disk space?

mikakaraila commented 4 years ago

Question did you install OPC DA not OPC UA as in first screenshot?

There should be some installation log... it would help to solve this.

apfelsaft87 commented 4 years ago

I tested the latest release 0.2.87 but still get this error:

13.10.2020, 20:57:15node: OPC UA Client
msg : error
"Error: get-installed-path: module not found "node-opcua-client" in path /usr/local/addons/redmatic/var/node_modules/node-red-contrib-opcua/node-opcua-client"

I will try to reinstall now.

apfelsaft87 commented 4 years ago

I reinstalled now but still same error message

mikakaraila commented 4 years ago

Then this path that I put into the code is wrong: /usr/local/addons/redmatic/var/node_modules/node-red-contrib-opcua/node-opcua-client

Can you check where node-opcua-client is installed on redmatic?

apfelsaft87 commented 4 years ago

Sure! How can I find it out?

mikakaraila commented 4 years ago

Login to redmatic and use cd /var/local/addons/redmatic/var/node_modules Then command ls and next folder to find out actual installation path. Or is it under ? /usr/local/addons/redmatic/var/node_modules/node-red-contrib-opcua/node_modules/node-opcua-client

apfelsaft87 commented 4 years ago

Okay I've tried:

# cd /var/local/addons/redmatic/var/node_modules
-sh: cd: can't cd to /var/local/addons/redmatic/var/node_modules: No such file or directory

And then:

# cd /usr/local/addons/redmatic/var/node_modules/node-red-contrib-opcua/
# ls
LICENSE
Readme.md
function connect_opcua_client code.txt
images
node_modules
opcua
package.json
test.bat
mikakaraila commented 4 years ago

OK it is under /usr not /var, I will fix path to code: /usr/local/addons/redmatic/var/node_modules/node-red-contrib-opcua/node_modules

Then it should find node-opcua-client package.

apfelsaft87 commented 4 years ago

Okay thank you!

As soon as I can update or I can test something for you just tell me.

Thank you for your great help!!!

motomoto-254 commented 4 years ago

please help, getting error:- Error: get-installed-path: module not found "node-opcua-client" in path C:\Users\hp.node-red\node_modules\node-red-contrib-opcua\node-opcua-client

mikakaraila commented 4 years ago

v0.2.88 contain fix.