I am unable to flash binary from the CLI on MacOS. I have attempted to reinstall and update both NodeJS, particle-cli, as well as have used nvm to attempt to run this with different versions of node, and I am getting the same message:
TypeError: Cannot read property 'flashDevice' of undefined
at Object.extend.flashYModem (/usr/local/lib/node_modules/particle-cli/commands/FlashCommand.js:146:16)
at Object.extend.flashSwitch (/usr/local/lib/node_modules/particle-cli/commands/FlashCommand.js:122:18)
at Object.BaseCommand.runCommand (/usr/local/lib/node_modules/particle-cli/commands/BaseCommand.js:108:17)
at Object.Interpreter.runCommand (/usr/local/lib/node_modules/particle-cli/lib/interpreter.js:100:13)
at Object.Interpreter.handle (/usr/local/lib/node_modules/particle-cli/lib/interpreter.js:56:18)
at Object. (/usr/local/lib/node_modules/particle-cli/bin/particle.js:20:5)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:456:32)
at tryModuleLoad (module.js:415:12)
Well, that does get me the end goal, which is to flash the device, so thank you for that.
That being said, I still get some errors - e.g the, "Expected 48 got 46" error. I'm bothered by the fact that there is something screwy with NodeJS-particle-cli when the last time I worked with this about a month ago, there were no problems. Could it be that the most recent update of NodeJS is not compatible with particle-cli or something?
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util / Tickets
dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Deducing device DFU version from functional descriptor length
Opening DFU capable USB device...
ID 2b04:d00a
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash "
Downloading to address = 0x08080000, size = 23456
Download [=========================] 100% 23456 bytes
Download done.
File downloaded successfully
Since I was able to accomplish uploading my firmware via DFU, I am moving on to my next issue, and currently working on getting data sent to the Google Cloud via the Particle Integration, re:
Thread is quite old but for others having this issue I can confirm that the above command fixes it. I was facing this issue after updating my node.js installation on Windows 10 for another project and suddenly my Particle CLI started reporting errors. Running the install command mentioned above fixed it right away