Why am I encountering a 'serialport.list is not a function' error when using Johnny Five with the Arduino board and how can I fix it?

86 views Asked by At

I'm working on executing JavaScript on an Arduino board using the "Johnny Five" library. However, I encountered an issue when trying to install the required dependencies, specifically the "serialport" module. After installing "serialport," I received the following error:

serialport.list().then(results => {
               ^

TypeError: serialport.list is not a function

Could anyone provide guidance or help me troubleshoot this problem? Thank you.

This is my code:

const { Board, Led } = require('johnny-five');

const board = new Board();

board.on('ready', () => {
  const led = new Led(13);
  led.blink(500);
});
0

There are 0 answers