node-opcua-client is the client-side module of a comprehensive OPC UA SDK written entirely in JavaScript and Node.js, providing robust connectivity to OPC UA servers. Currently at version 2.169.0, the library exhibits a rapid and consistent release cadence, often featuring multiple patch and minor releases per month to introduce new features, performance enhancements, and bug fixes. Key differentiators include its pure Node.js implementation, broad support for various OPC UA specifications (including OPC UA 1.05 compliance), and a strong emphasis on performance through optimizations in data type handling, transport, and secure channel operations. The project maintains an open-source MIT license but offers commercial support, advanced documentation, and value-added extensions through Sterfive SAS, catering to professional and industrial applications.
npm install node-opcua-clientVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to connect to an OPC UA server, create a session, and read a value from a well-known NodeId (Server_ServerStatus_CurrentTime).
Review your codebase for any non-public API usages, especially those that might have implicitly relied on `async` or `lodash` internal structures. Test thoroughly after upgrading.
Be aware of the support model; consider a NodeOPCUA Membership for critical production applications or when extensive documentation and direct support are required. Rely on community forums or Stack Overflow for general questions.
Ensure client and server certificates are correctly generated and mutually trusted. Place client certificates in the server's trust list and vice-versa. Verify `securityMode` and `securityPolicy` settings in `OPCUAClient.create` align with the server's configuration. For development, `MessageSecurityMode.None` and `SecurityPolicy.None` can bypass certificate issues.
If running an OPC UA server behind a proxy or NAT, configure its 'advertised endpoints' to expose the correct external IP address and port that clients should use for connection. Refer to the server's documentation or node-opcua server documentation for details on this configuration.
Implement robust error handling and retry logic around `createSession` and subscription creation. Consider periodically checking session status and actively recreating subscriptions if `keepalive_failure` or `session_closed` events are received. Ensure client application logic can handle transient disconnections and re-initialization.
Verify that the OPC UA server application is running and listening on the specified `endpointUrl` (e.g., `opc.tcp://localhost:4840`). Check firewall rules on both the client and server machines. Use `telnet` or `nc` to manually test network reachability to the server's IP and port.
Ensure the client's application certificate (usually generated automatically or found in a 'PKI/own/certs' folder) is copied to the server's trusted client certificates folder. Alternatively, set `securityMode: MessageSecurityMode.None` and `securityPolicy: SecurityPolicy.None` in `OPCUAClient.create` for unsecure connections (not recommended for production).
If using username/password authentication, verify the credentials are correct and the server supports this user identity token type on the chosen endpoint. If connecting anonymously, ensure the server's endpoint allows anonymous user access.
Double-check the NodeId string for typos (e.g., `ns=X;i=Y` for numeric, `ns=X;s=StringId` for string). Use an OPC UA client browser tool (like UA Expert) to verify the exact NodeId and its attributes on the target server.
Ensure the system clocks on both the client and the OPC UA server machines are synchronized, ideally using NTP (Network Time Protocol). A time difference of more than a few minutes can lead to handshake failures.
No dependency data recorded yet.