CLI on Macbook so I can flash using USB


I decided to go back to the ili9341 library that actually managed to compile and get something on the screen. Since my PC is no longer able to log in, I’m using this macbook, I was able to compile, flash, and see the display. Twice. Not again. Get repeatedly “flash unsuccessful.” The particle electron continues to breathe cyan.

So I installed the cli, hoping to flash by USB.

I managed to do particle login, but other than that, I constantly get messages on the mac terminal:

Error loading command /usr/local/lib/node_modules/particle-cli/commands/SerialCommand.js Error: The module '/usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/Release/serialport.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 48. This version of Node.js requires
NODE_MODULE_VERSION 59. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).

npm rebuild seems to have worked, but didn’t solve the problem…
npm install gives me a bunch of errors:

MacBook:~ tentoes$ npm install
npm WARN saveError ENOENT: no such file or directory, open '/Users/tentoes/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/Users/tentoes/package.json'
npm WARN tentoes No description
npm WARN tentoes No repository field.
npm WARN tentoes No README data
npm WARN tentoes No license field.

up to date in 0.504s


Maybe not the right NodeJS Version @Tentoes.
Check your version with node --version



As @nrobinson2000 mentioned, you definitely want to run these commands using sudo.


@nrobinson2000, I’ll try that.

Today is an “up your confidence” day putting a small program in an ATTINY 10 for a birthday present for a silly girl.


Well. So much for confidence: The micro usb socket broke off my AVR progammer. Birthday girl got a card instead.

I seem to have the cli installed and working on this mac book, and I made a project, put the source files in the src folder and I can make and flash it thusly:

 rm *.bin
 particle compile electron
 (hold both buttons, release reset get it flashing yellow)
 particle flash --usb *.bin

I’ve done it a few times now with success. Now just need to build working source…