Johnny-Five problems with Node.js

394 Views Asked by At

I'm having troubles trying to use Johnny-Five with my Arduino Mega. The main problem is that it requires Node.js and I'm following the really easy instructions from this link, but typing node blink.js in the terminal it throw me an error like that.

I searched for that problem and someone says Node.js needs Xcode (that seems to work as a C++ compiler) to work properly. I use a MacBook Air and I don't want a 5+ GB app if not needed, so I want to know if my problem is that I haven't installed that app or it's something else.

2

There are 2 best solutions below

0
On

I think it's because you didn't install the module. I don't have time to read the full instruction, but I think you use some kind of module and you didn't installed it.

You need to run the command inside your project directory npm install ModuleName

If you didn't install node, you just need to install it with the mac installer.

0
On

You can install the XCode CLI tools only which includes the gcc compiler:

xcode-select --install

That should be everything that you need, and is a much smaller package (Not sure of the actual size but I believe it is well under 1gb).