[ISSUE] Fresh Install - particle-cli missing dependency

I just did a completely fresh install of Workbench from the market place. All the toolchains and extension folders were completely removed prior to install. Everything installed, restarted VS Code, then it prompted to install the dependencies, which completed without error, restarted VS code, then click “Particle: Login”…

Entered my details (correctly), and login failed with this error:

Error in particle-cli:
 !   Cannot find module 'chalk'
 !   See /Users/rus/.particle/error.log for more info.
Error: Command failed: /Users/rus/.vscode/extensions/particle.particle-vscode-core-1.4.8/src/cli/bin/darwin/amd64/particle login -u <redacted> -p <redacted> --otp <redacted> --no-update-check
 !   Error in particle-cli:
 !   Cannot find module 'chalk'
 !   See /Users/rus/.particle/error.log for more info.


	at makeError (/Users/rus/.vscode/extensions/particle.particle-vscode-core-1.4.8/node_modules/execa/index.js:174:9)
	at module.exports.Promise.all.then.arr (/Users/rus/.vscode/extensions/particle.particle-vscode-core-1.4.8/node_modules/execa/index.js:278:16)

- - - -

Since I’m a JS developer by trade, I went snooping and chalk is missing from the deps for the core package, I tried manually installing it with npm and that didn’t work either.


I ran the Particle Audit Environment, and the only notable thing pretty much says the same as above

    "cli": {
        "binpath": "/Users/rus/.vscode/extensions/particle.particle-vscode-core-1.4.8/src/cli/bin/darwin/amd64/particle",
        "ok": true,
        "version": "Error in particle-cli:\n !   Cannot find module 'chalk'\n !   See /Users/rus/.particle/error.log for more info."
    },

:thinking: hm. something weird must have happened mid-install. try this:

  1. close VSCode

  2. remove the CLI’s dependencies:

    cd ~/.particle
    rm -rf .npm-cache/ autoupdate error.log node-v8.15.0-darwin-x64/ node_modules/ package-lock.json plugin-cache.json tmp/
    
  3. open VSCode

  4. if prompted, install Particle Workbench dependencies. otherwise, run the Particle: Update CLI command

  5. wait for the install process to complete (takes a bit)

  6. run the Particle: Launch CLI command

  7. enter and execute particle --version in the terminal instance that launches

if things are working as expected, you should get a response like v1.42.0.

hope it helps!

Thanks @m_m. In the meantime, I had completely purged all remnants of VS code and all the extensions and all the particle dot files. Then reinstalled everything fresh, and it was working properly at that point.

Your instructions probably would have been quicker and more efficient; and I’ll try those next time!

Cheers

1 Like

ah, good to hear :+1:

sorry for the bumps! :pray: