Particle-cli broken? "Unexpected token {" [WORKAROUND]

hey all - apologies for the bumps here. i think the issue has been resolved. can you try running particle version and confirm you are error-free?

the problem appears to be related to the update mechanism - it doesn’t handle unexpected server responses well - otherwise v1.38.0 is ok (iow, downgrading isn’t going to help)

i’ll get it sorted :+1:

if you are a Workbench user and you’ve deleted your ~/.particle directory, you can do the following to get things back in order:

  1. launch VSCode
  2. you may be prompted to install dependencies, click “install” and wait for it to complete
  3. run the Particle: Update CLI command and wait for it to complete
  4. in the terminal panel that was launched, type particle version and confirm you are running v1.38.0

EDIT: if you’ve installed the CLI using our installers (docs), you may need to reinstall to get back up and running. the easiest way to do that is:

on windows:

  1. open a file explorer and navigate to C:\Users\<you>\AppData\Local\particle
  2. remove the following directories: .npm-cache, node_modules, node-v5.4.1-windows-x64
  3. open a powershell terminal and type particle version

on mac & linux:

  1. open a terminal
  2. go to your particle directory cd ~/.particle
  3. remove cli dependencies rm -rf ./node-v5.4.1-darwin-x64 ./.npm-cache ./node_modules (or linux as appropriate)
  4. run particle version

in both cases, you should see the “particle: Installing plugins…” message followed after some delay by 1.38.0.

2 Likes