rwaldron / johnny-five

JavaScript Robotics and IoT programming framework, developed at Bocoup.

Home Page:http://johnny-five.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

johnny-five not working

Sarthak-Arya opened this issue · comments

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

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

Or what's the result actually..

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

I'm facing same problem.

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.

npm i firmata

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')

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

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

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