johnny-five
johnny-five copied to clipboard
RaspberryPi issue
I'm using Raspberry Pi 4B.
code:
var five = require("johnny-five");
var board = new five.Board();
board.on("ready", function() {
console.log('Ready!');
});
Error:
internal/deps/acorn/acorn/dist/acorn.js:4015
(ch >= 0x41 /* A */ && ch м쀽 0聸耵C *РØ 肪, ɼ|逊 Ȩ 0䀨䡣jĠ>= 0x¶1 /ЪĠá */(&₦耠䁣聨ࠨ¼耿 8¸‷䉁Ƞ/쀪ဠࡺ */)
^^
SyntaxError: Unexpected identifier
at Object.<anonymous> (/home/user/Desktop/node_modules/johnny-five/lib/repl.js:2:14)
As i was testing the issue, error is displayed in the first line (var five = require("johnny-five");).
I have no issues with my Pi 400s.
But the provided error code looks more like a broken source file than an issue with Johnny-Five. It should be impossible for a Johnny-Five error to produce a SyntaxError.
I'd try rm -rf node_modules && npm install.
In addition you can try to install the main branch instead of npm (npm last update is 3years ago, while github is 1year ago). https://github.com/rwaldron/johnny-five?tab=readme-ov-file#source-code