Skip to content

Commit

Permalink
Update zeromq.
Browse files Browse the repository at this point in the history
  • Loading branch information
iaj2 committed Dec 4, 2023
1 parent 0308665 commit 86f342e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 44 deletions.
29 changes: 1 addition & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,6 @@
JavaScript RPC Client for EdgePi RPC Server

## Installing as an NPM module
If you are not on a debian system, you can simply run the following npm command on any machine:
```
npm install @edgepi-cloud/edgepi-rpc
```
## Installing as an NPM module on Debian systems

There is currently an issue regularly installing zeromq as a dependency on debian systems. The culprit is the following error:
```
symbol lookup error: /**/node_modules/zeromq/build/Release/zeromq.node: undefined symbol: sodium_init
```
To get around this issue, you must first install the zeromq library (libzmq)
```
sudo apt update
sudo apt install libzmq3-dev
```
You will then need to npm install the zeromq dependency specifying that you want to build with with installed
library from the previous step. First ensure you have necessary build dependancies
```
sudo apt-get update && sudo apt-get install -y build-essential cmake
```
Then npm install zeromq with the shared library.
```
npm install zeromq@6.0.0-beta.17 --zmq-shared
```
Now you can simply install edgepi-rpc with the organization's scope from npm
```
npm install @edgepi-cloud/edgepi-rpc
```
If you run into any issues with zeromq after installing the edgepi-rpc package, try reinstalling zeromq
ensuring that it was built against the shared library. For further help installing zeromq, checkout their [github](https://github.com/zeromq/zeromq.js/).
```
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@types/node": "^20.4.2",
"protobufjs": "^7.2.4",
"protobufjs-cli": "^1.1.1",
"zeromq": "^6.0.0-beta.17"
"zeromq": "^6.0.0-beta.19"
},
"devDependencies": {
"@types/jest": "^29.5.3",
Expand Down
11 changes: 11 additions & 0 deletions tests/integration/bug-fixes.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const zmq = require('zeromq');

jest.unmock('zeromq')

describe('zeromq bug fix', () => {
test('should create zmq.Context without libsodium error', () => {
expect(() => {
let a = new zmq.Context();
}).not.toThrow();
});
});

0 comments on commit 86f342e

Please sign in to comment.