Error compiling in command line

I get the following error when compiling in the command line.

C: ... \Blinky>particle compile p blinker.ino

Compiling code for photon

Including:
    blinker.ino
attempting to compile firmware
pushing file: blinker.ino
compile got error:  { [Error: read ECONNRESET] code: 'ECONNRESET', errno: 'ECONN
RESET', syscall: 'read' }
Compile failed. Exiting.

I can compile just fine is Particle Dev. Compiling used to work for me in the command line but hasn’t since I got DFU-Util installed and working.

Whenever I see the ECONNRESET elsewhere on this forum there’s another error associated with it, but I don’t see that in this case.

Could you try

npm update -g particle-cli

and then try to compile a minimum sketch like this

void setup() { }
void loop() { }

I get the same error.

C: .. \min>particle compile p min.ino

Compiling code for photon

Including:
    min.ino
attempting to compile firmware
pushing file: min.ino
compile got error:  { [Error: read ECONNRESET] code: 'ECONNRESET', errno: 'ECONN
RESET', syscall: 'read' }
Compile failed. Exiting.

I also didn’t get any feedback after running update. It waited for a few seconds and then continued

Do you get any other response of CLI e.g. for particle list?

I do get response from particle list. It searches for devices and then returns:

C:>particle list
@ Retrieving devices...listDevices got error:  { [Error: read ECONNRESET] code:
'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' }
Potentially unhandled rejection [2] Error: read ECONNRESET
    at exports._errnoException (util.js:746:11)
    at TCP.onread (net.js:559:26)
Potentially unhandled rejection [3] Error: read ECONNRESET
    at exports._errnoException (util.js:746:11)
    at TCP.onread (net.js:559:26)

I am able to flash over USB using “particle flash --usb”

Hmm, that looks as if your node.js (or less likely particle-cli) got somehow damaged.

Try npm uninstall -g particle-cli and npm install -g particle-cli first and if this does not help, you might have to reinstall node.js.

Trying that now. I am on satellite internet here, which is why I am flashing locally. Could that effect anything?

It might, depending on the connection quality (interruptions) and latency (timeouts).

Wasn’t able to reinstall particle-cli. Lot’s of errors, but the first was this

MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe".
 To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visua
l Studio 2005 or 3) add the location of the component to the system path if it
is installed elsewhere.  [C:\Users\...\AppData\Roaming\npm\node_modules\particl
e-cli\node_modules\serialport\build\binding.sln]

I’ll try re-installing node.js

I am runnning the x64 version of 0.12.7 of node. It was working before.

You have not by any chance upgraded to Windows 10?
If so, you might need to (re)install the .NET Framework 3.5 (which contains 2.0 too).

This easiest done via Contral Panel - Add/Remove Programms -> Add/Remove Features.

No. I’m on windows 7, and planning to stay there with this machine.

1 Like

Then I’m at the end of my wits and have to hand you over to cleverer guys like @kennethlimcp or @suda

Thanks for your help @ScruffR. I will try reinstalling .net, maybe there was an update that changed it.

You could give this a try, which has worked for me in the past:

You can select what you want to install, including the CLI :smile:

What does particle config identify say?

Right now I can’t get CLI to install. I’m running the toolchain installer, hopefully that will work but it will take a while with satellite internet connection.

Ran the toolchain, it installed everything with no errors. But the command line doesn’t recognize particle-cli and when I try to npm install particle-cli, it still fails with the same MSB3428 error. :disappointed:

Command line won’t understand particle-cli but should know particle

And the npm line should look like this npm install -g particle-cli (-g for global install)

Okay, so I was on the road for a couple days and haven’t been able to work on this. Before I left, I shut my computer down and it had some updates to install. One of those updates must have been important to this as when I came back, I ran npm install and it worked!

particle list and flash --usb is working too!

My guess is the toolchain fixed whatever pieces were broken.

Thanks everyone who helped

1 Like