-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
41 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,19 +32,14 @@ jobs: | |
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16.20.0" | ||
node-version: "20.10.0" | ||
cache: "npm" | ||
|
||
- name: Install npm@9.8.0 | ||
run: npm i -g npm@9.8.0 | ||
- name: Install npm@10.2.3 | ||
run: npm i -g npm@10.2.3 | ||
|
||
- name: Install dependencies | ||
run: npm ci --prefer-offline | ||
|
||
- name: Reinstall zeromq because of Debian bug | ||
run: | | ||
npm uninstall zeromq | ||
npm install [email protected] --zmq-shared | ||
|
||
- name: Test with jest | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,33 +2,12 @@ | |
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 [email protected] --zmq-shared | ||
``` | ||
Now you can simply install edgepi-rpc with the organization's scope from npm | ||
``` | ||
npm install @edgepi-cloud/edgepi-rpc | ||
## Install build dependencies | ||
|
||
``` | ||
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/). | ||
sudo apt update && sudo apt install cmake | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node' | ||
testEnvironment: 'node', | ||
maxWorkers: 1 // Forces tests to run sequentially instead of in parallel. Issue: https://github.com/EdgePi-Cloud/edgepi-rpc-client-js/issues/46 | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,7 @@ | |
"outDir": "./lib" | ||
}, | ||
"include": [ | ||
"./src"] | ||
"./src", | ||
"./jest.config.js" | ||
] | ||
} |