Cannot find module './encoding/utf8'

Hello.

I am trying to use an older laptop for production to program Boron units. I had previously used this same laptop but now when trying to do anything with particle CLI to perform a particle flash firmware, I get the following error.
From the error.log file.

2023/05/30 15:12:51 node:internal/modules/cjs/loader:1029
throw err;
^

Error: Cannot find module './encoding/utf8'
Require stack:

  • C:\Users\canlab\AppData\Local\particle\node_modules\particle-cli\node_modules\chardet\index.js
  • C:\Users\canlab\AppData\Local\particle\node_modules\particle-cli\node_modules\inquirer\node_modules\external-editor\main\index.js
  • C:\Users\canlab\AppData\Local\particle\node_modules\particle-cli\node_modules\inquirer\lib\prompts\editor.js
  • C:\Users\canlab\AppData\Local\particle\node_modules\particle-cli\node_modules\inquirer\lib\inquirer.js
  • C:\Users\canlab\AppData\Local\particle\node_modules\particle-cli\src\app\ui.js
  • C:\Users\canlab\AppData\Local\particle\node_modules\particle-cli\src\app\update-check.js
  • C:\Users\canlab\AppData\Local\particle\node_modules\particle-cli\src\app\cli.js
  • C:\Users\canlab\AppData\Local\particle\node_modules\particle-cli\src\index.js
  • C:\Users\canlab\AppData\Local\particle[eval]
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1026:15)
    at Function.Module._load (node:internal/modules/cjs/loader:871:27)
    at Module.require (node:internal/modules/cjs/loader:1098:19)
    at require (node:internal/modules/cjs/helpers:108:18)
    at Object. (C:\Users\canlab\AppData\Local\particle\node_modules\particle-cli\node_modules\chardet\index.js:4:13)
    at Module._compile (node:internal/modules/cjs/loader:1196:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
    at Module.load (node:internal/modules/cjs/loader:1074:32)
    at Function.Module._load (node:internal/modules/cjs/loader:909:12)
    at Module.require (node:internal/modules/cjs/loader:1098:19)
    2023/05/30 11:12:51 Time since last update 24m16.1230176s, update in background

I have uninstalled Visual Studio Code and reinstalled it via Particle's website link. The install didn't complain.
This machine is running Windows 10 Pro, Version 22H2.

Any suggestions are welcome.
Thanks.

Hello! We recently updated the Node version used in the CLI. Please see the following post for more details on this and troubleshooting steps to follow.

Let me know if this helps!

I renamed the folder found in AppData/Local and performed a new install and that seemed to work.

Thanks for the fast response.

1 Like

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