rwaldron / johnny-five

JavaScript Robotics and IoT programming framework, developed at Bocoup.
http://johnny-five.io
Other
13.26k stars 1.76k forks source link

johnny-five not working #1807

Open Sarthak-Arya opened 1 year ago

Sarthak-Arya commented 1 year ago
const { Board, Led } = require("johnny-five");
const board = new Board({port:"COM3"});

board.on("ready", () => {

  // Create a standard `led` component instance
  const led = new Led(13);
  this.repl.inject({
    led: led
  });
  // "blink" the led in 500ms
  // on-off phase periods
  led.blink(1000);
});

Above is my code

Screenshot 2022-12-29 235929

Here is the output is not showing anything I am using Windows 11 x64 bit system

Jahson17 commented 1 year ago

Is it throwing an error like "cannot find module 'firmata' " ???

Or what's the result actually..

iabdo9 commented 1 year ago

Is it throwing an error like "cannot find module 'firmata' " ???

I don't think so, but I'm facing this error, is there a solution?, I tried install firmata package but always fails: npm ERR

princeborn1999 commented 1 year ago

I'm facing same problem.

WyattSanders commented 10 months ago

Is it throwing an error like "cannot find module 'firmata' " ???

Or what's the result actually..

Error: Cannot find module 'firmata'

It's almost a year later and I'm having the same issue with no ability to find a solution.

tbaltrushaitis commented 10 months ago

npm i firmata

tbaltrushaitis commented 10 months ago
const { Board, Led } = require("johnny-five");
const board = new Board({port:"COM3"});

board.on("ready", () => {

  // Create a standard `led` component instance
  const led = new Led(13);
  this.repl.inject({
    led: led
  });
  // "blink" the led in 500ms
  // on-off phase periods
  led.blink(1000);
});

Above is my code

Screenshot 2022-12-29 235929

Here is the output is not showing anything I am using Windows 11 x64 bit system

Your code shouldn't output anything. It should blink the default led on your board (of course if it is really on port 'COM3')

tbaltrushaitis commented 10 months ago

Also I'm not sure if this would represent your board because of () => {}

WyattSanders commented 10 months ago

npm i firmata

This wouldn't fix it, and there would be a laundry list of problems that would follow. I have however figured out the root cause for this issue and others People trying to run Johnny-five with a fresh install of Windows 10 or 11 and windows build tools 2022 CANNOT install johnny-five with "npm install" I have found that you need node version 13.14.0 or 14.17.0 (if you tried installing johnny-five with a newer version you need to delete your node_modules folder then change versions of node with nvm-windows) then install VS Build Tools 2019 (VS Build Tools 2022 will not work!) with C++ development.

After this johnny-five can install successfully with npm install. (Antivirus may also need turned off, run from powershell with administrator privileges too)

VS Build Tools 2019 Download: https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16&src=myvs&utm_medium=microsoft&utm_source=my.visualstudio.com&utm_campaign=download&utm_content=vs+buildtools+2019

image

reymesson1 commented 9 months ago

Remember also to turn off any Bluetooth connection, make sure that the package.json has into script: "firmata": "firmata-party uno --debug" and npm run firmata. And then node index.js

S9963hd commented 1 month ago

i tried so many ways to rectify this issue,but i can't

PS D:\J5> node index.js node:internal/modules/cjs/loader:1080 throw err; ^

Error: Cannot find module 'serialport' Require stack:

Node.js v18.18.0 PS D:\J5>

tbaltrushaitis commented 1 month ago

i tried so many ways to rectify this issue,but i can't

PS D:\J5> node index.js node:internal/modules/cjs/loader:1080 throw err; ^

Error: Cannot find module 'serialport'

Install it as described here