Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: spawn nj-cli ENOENT when building ~/.npm-global/lib/node_modules/@fraction/oasis/node_modules/ssb-validate2-rsjs-node #747

Open
bgpugh opened this issue Sep 7, 2021 · 2 comments

Comments

@bgpugh
Copy link

bgpugh commented Sep 7, 2021

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 debug@4.1.1: 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 highlight.js@9.18.5: Support has ended for 9.x series. Upgrade to @latest
npm WARN deprecated emoji-named-characters@1.0.2: 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)

@bgpugh
Copy link
Author

bgpugh commented Sep 17, 2021

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 git@github.com: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 test

The build process creates bindings in ./dist/index.node.

If you wish to rebuild the bindings after making changes to the code, use the nj-cli tool:

nj-cli build --release

@bgpugh
Copy link
Author

bgpugh commented Sep 17, 2021

Confirmed: Making sure I had a working Rust and nj-cli as above resolved the issue. Installation documentation needs to be updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant