Error: spawn nj-cli ENOENT when building ~/.npm-global/lib/node_modules/@fraction/oasis/node_modules/ssb-validate2-rsjs-node
What's the problem you want solved?
When running npm -g install fraction/oasis#semver:on the current stable release of Manjaro-ARM, the build fails with the following:
$ npm -g install fraction/oasis#semver:
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated [email protected]: Support has ended for 9.x series. Upgrade to @latest
npm WARN deprecated [email protected]: This package is no longer maintained
npm ERR! code 1
npm ERR! path ~/.npm-global/lib/node_modules/@fraction/oasis/node_modules/ssb-validate2-rsjs-node
npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! node:internal/errors:464
npm ERR! ErrorCaptureStackTrace(err);
npm ERR! ^
npm ERR!
npm ERR! Error: spawn nj-cli ENOENT
npm ERR! at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
npm ERR! at onErrorNT (node:internal/child_process:477:16)
npm ERR! at processTicksAndRejections (node:internal/process/task_queues:83:21) {
npm ERR! errno: -2,
npm ERR! code: 'ENOENT',
npm ERR! syscall: 'spawn nj-cli',
npm ERR! path: 'nj-cli',
npm ERR! spawnargs: [ 'build', '--release' ]
npm ERR! }
FWIW, this also fails in the same way when building Patchwork, as well as with TOT (npm -g install . when in repository)
I just looked into https://www.npmjs.com/package/ssb-validate2-rsjs-node, which mentions that the package requires rust to be installed and functional:
Rust first needs to be installed in order to build the bindings (installation instructions).
git clone [email protected]:ssb-ngi-pointer/ssb-validate2-rsjs-node.git cd ssb-validate2-rsjs-node cargo install nj-cli # generate release build of ssb-validate2-rsjs-node npm run build # run the tests npm run testThe build process creates bindings in
./dist/index.node.If you wish to rebuild the bindings after making changes to the code, use the
nj-clitool:
nj-cli build --release
Confirmed: Making sure I had a working Rust and nj-cli as above resolved the issue. Installation documentation needs to be updated