Can't perform Local Flash all of a sudden

Trying to load a project onto a locally connected Argon, connected via USB. I have never had a problem loading this project. Today, all of a sudden, VS Code refuses to load the device.

:::: PUTTING DEVICE INTO DFU MODE

 !   Error in particle-cli:
 !   Cannot find module 'xtend'
Require stack:
- C:\Users\Kevin\AppData\Local\particle\node_modules\particle-cli\settings.js    
- C:\Users\Kevin\AppData\Local\particle\node_modules\particle-cli\dist\app\cli.js
- C:\Users\Kevin\AppData\Local\particle\node_modules\particle-cli\dist\index.js  
- C:\Users\Kevin\AppData\Local\particle\[eval]
 !   See C:\Users\Kevin\AppData\Local\particle\error.log for more info.

:::: FLASHING APPLICATION & DEVICE OS

^^^ this eventually fails.

The code does compile, though it takes forever to compile.

I noticed when I started VS Code today, it looked like it was spinning doing some kind of update for a while.

I also noticed this line by itself in the “Output” tab of VS code, I’ve never seen this before and wonder if it is related.

[5/3/2021, 5:15:31 PM] For C++ source files, IntelliSenseMode was changed from "windows-gcc-x64" to "windows-gcc-arm" based on compiler args and querying compilerPath: "C:\Users\Kevin\.particle\toolchains\gcc-arm\9.2.1\bin\arm-none-eabi-gcc.exe"

Any help would be much appreciated. Thanks!

Hi @kkeng - mind following the troubleshooting steps here? Troubleshooting Particle Workbench – Particle Support

Most critical would be to ensure you can compile & flash a blank sketch.

Hello everyone. I tried to follow the above troubleshooting. Still unable to do anything with Workbench. This problem is becoming urgent now. I appreciate any help.

Everything I try, I get the error: Cannot find module ‘xtend’

Everything was working fine, I tried to re-load a project I’ve used many times, it fails. I am also unable to create a new project. I get the same error regarding the xtend module.

I am able to compile applications. I have tried compiling for 1.4.4, 1.5.2, 2.0.1 and 2.1.0. Exact same problem on all versions. Targeting Argon right now.

I have tried uninstalling Workbech and completely uninstalled VSCode and re-installed everything. Still the exact same problem.

When I try to create a new project in Workbench, it fails and I get the following in the “Output” window in VSCode.

Error in particle-cli:
 !   Cannot find module 'xtend'
Require stack:
- C:\Users\Kevin\AppData\Local\particle\node_modules\particle-cli\settings.js
- C:\Users\Kevin\AppData\Local\particle\node_modules\particle-cli\dist\app\cli.js
- C:\Users\Kevin\AppData\Local\particle\node_modules\particle-cli\dist\index.js
- C:\Users\Kevin\AppData\Local\particle\[eval]
 !   See C:\Users\Kevin\AppData\Local\particle\error.log for more info.
Error: Command failed with exit code 1: c:\Users\Kevin\.vscode\extensions\particle.particle-vscode-core-1.13.8\src\cli\bin\windows\amd64\particle.exe project create --name testproj02 c:\Users\Kevin\Documents --no-update-check
 !   Error in particle-cli:
 !   Cannot find module 'xtend'
Require stack:
- C:\Users\Kevin\AppData\Local\particle\node_modules\particle-cli\settings.js
- C:\Users\Kevin\AppData\Local\particle\node_modules\particle-cli\dist\app\cli.js
- C:\Users\Kevin\AppData\Local\particle\node_modules\particle-cli\dist\index.js
- C:\Users\Kevin\AppData\Local\particle\[eval]
 !   See C:\Users\Kevin\AppData\Local\particle\error.log for more info.
	at makeError (c:\Users\Kevin\.vscode\extensions\particle.particle-vscode-core-1.13.8\node_modules\execa\lib\error.js:59:11)
	at handlePromise (c:\Users\Kevin\.vscode\extensions\particle.particle-vscode-core-1.13.8\node_modules\execa\index.js:114:26)
	at processTicksAndRejections (internal/process/task_queues.js:93:5)
	at async c:\Users\Kevin\.vscode\extensions\particle.particle-vscode-core-1.13.8\src\commands\lib\create-project.js:55:11

- - - -

When I attempt to upload a project that does compile, I get the follwing in the VS Code “Terminal” window. It is the same problem “Cannot find module ‘xtend’”

> Executing task: make -f 'C:\Users\Kevin\.particle\toolchains\buildscripts\1.10.0\Makefile' flash-user -s <


:::: PUTTING DEVICE INTO DFU MODE

 !   Error in particle-cli:
 !   Cannot find module 'xtend'
Require stack:
- C:\Users\Kevin\AppData\Local\particle\node_modules\particle-cli\settings.js    
- C:\Users\Kevin\AppData\Local\particle\node_modules\particle-cli\dist\app\cli.js
- C:\Users\Kevin\AppData\Local\particle\node_modules\particle-cli\dist\index.js  
- C:\Users\Kevin\AppData\Local\particle\[eval]
 !   See C:\Users\Kevin\AppData\Local\particle\error.log for more info.

:::: FLASHING APPLICATION

Creating c:/Users/Kevin/Documents/Code/Particle/Explant_BaseStation_01/target/1.4.4/argon/platform_user_ram.ld ...
Creating c:/Users/Kevin/Documents/Code/Particle/Explant_BaseStation_01/target/1.4.4/argon/platform_user_ram.ld ...
   text    data     bss     dec     hex filename
  23928     196    3488   27612    6bdc c:/Users/Kevin/Documents/Code/Particle/Explant_BaseStation_01/target/1.4.4/argon/Explant_BaseStation_01.elf
dfu-suffix (dfu-util) 0.9

Copyright 2011-2012 Stefan Schmidt, 2013-2014 Tormod Volden
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Suffix successfully added to file
Serial device PARTICLE_SERIAL_DEV : not available
Flashing using dfu:
dfu-util 0.9

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 http://sourceforge.net/p/dfu-util/tickets/

No DFU capable USB device available
make[2]: *** [../../../build/module.mk:129: program-dfu] Error 74
make[1]: *** [../build/recurse.mk:12: modules/argon/user-part] Error 2
make: *** [C:\Users\Kevin\.particle\toolchains\buildscripts\1.10.0\Makefile:86: flash-user] Error 2
The terminal process "C:\Users\Kevin\.particle\toolchains\buildtools\1.1.1\bin\bash.exe '-c', 'make -f 'C:\Users\Kevin\.particle\toolchains\buildscripts\1.10.0\Makefile' flash-user -s'" terminated with exit code: 2.

Press any key to close the terminal.

The note says to check the error.log file. I cleared the contents, then attempted the upload again which failed. This is what was added to error.log when it failed;

2021/05/20 21:26:38 Time since last update 1h40m41.55914s, update in block
2021/05/21 04:26:38 internal/modules/cjs/loader.js:985
  throw err;
  ^

Error: Cannot find module 'xtend'
Require stack:
- C:\Users\Kevin\AppData\Local\particle\node_modules\particle-cli\settings.js
- C:\Users\Kevin\AppData\Local\particle\node_modules\particle-cli\dist\app\cli.js
- C:\Users\Kevin\AppData\Local\particle\node_modules\particle-cli\dist\index.js
- C:\Users\Kevin\AppData\Local\particle\[eval]
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (C:\Users\Kevin\AppData\Local\particle\node_modules\particle-cli\settings.js:31:14)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
2021/05/20 21:26:38 Time since last update 1h40m41.6574868s, update in background

Did you delete both particle directories?

C:\Users\Kevin\.particle
C:\Users\Kevin\AppData\Local\particle

Slightly unrelated but worth pointing out:

Particle tools like Workbench and particle-cli work better on Linux and macOS than Windows. Some people can get offended when you suggest that Linux is better than Windows for many tasks, especially development.

If you continue to get this problem on Windows I’d recommend trying Linux. If you’re looking for distro recommendations, Pop!_OS, Manjaro, Linux Mint are good choices for a first distro.

2 Likes

Thank you Sir! I got rid of those directories as well as a Code directory in my AppData/roaming folder.

After a clean install of VS Code and Particle Workbench everything seems to be working now.

Thank you again. That had me jammed up for a while.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.