Segmentation fault when using johnny-five with deno

I want to using johnny-five with deno, here is my code:
// @deno-types="npm:@types/johnny-five"
import { Board, Led } from "johnny-five";

const board = new Board();

board.on("ready", () => {
const led = new Led(13);

led.blink(1000);
});
// @deno-types="npm:@types/johnny-five"
import { Board, Led } from "johnny-five";

const board = new Board();

board.on("ready", () => {
const led = new Led(13);

led.blink(1000);
});
But when I try to run it, I got this
zsh: segmentation fault deno run -A main.ts
zsh: segmentation fault deno run -A main.ts
Any idea how to solve it? (Note: node-gyp has been installed with Deno globally, also added --allow-script params, no error occurred when installing)
3 Replies
美味的小圓
美味的小圓OP2w ago
And for now, below is error message printed if I deleted node_module directory and run command deno install --allow-scripts
error: script 'install' in '@serialport/bindings@8.0.8' failed with exit code 1
stderr:
prebuild-install WARN install No prebuilt binaries found (target=22.14.0 runtime=node arch=arm64 libc= platform=darwin)
error: Failed resolving binary export. '/Users/kay/Desktop/johnnytest/node_modules/.deno/node-gyp@11.2.0/node_modules/node-gyp/package.json' did not exist

error: failed to run scripts for packages: @serialport/bindings@8.0.8
error: script 'install' in '@serialport/bindings@8.0.8' failed with exit code 1
stderr:
prebuild-install WARN install No prebuilt binaries found (target=22.14.0 runtime=node arch=arm64 libc= platform=darwin)
error: Failed resolving binary export. '/Users/kay/Desktop/johnnytest/node_modules/.deno/node-gyp@11.2.0/node_modules/node-gyp/package.json' did not exist

error: failed to run scripts for packages: @serialport/bindings@8.0.8
美味的小圓
美味的小圓OP2w ago
After deno add --allow-scripts node-gyp and install again: https://paste.myst.rs/bzlmpjy4
pastemyst | (untitled)
a powerful website for storing and sharing text and code snippets. completely free and open source.
美味的小圓
美味的小圓OP2w ago
But for node.js there is no node-gyp error like that when installing 🤔

Did you find this page helpful?