[ISSUE] - Workbench installation of CLI dependencies fails

Installation on a typical corporate laptop. Adding the particle extensions to Visual Studio, results in the following error installing the CLI:

particle: Installing plugins...npm ERR! As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead. On the other hand, if you're debugging an issue with the installer, you can use npm install --cache /tmp/empty-cache to use a temporary cache instead of nuking the actual one.
npm ERR!
npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\awarner\AppData\Local\particle.npm-cache_logs\2019-02-22T00_44_50_440Z-debug.log

! exit status 1

particle: Installing plugins (retrying)...
! Error installing package.
! 'prebuild-install' is not recognized as an internal or external command,
! operable program or batch file.
! gyp ERR! build error
! gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1
! gyp ERR! stack at ChildProcess.onExit (C:\Users\awarner\AppData\Local\particle\node-v8.15.0-windows-x64\lib\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
! gyp ERR! stack at emitTwo (events.js:126:13)
! gyp ERR! stack at ChildProcess.emit (events.js:214:7)
! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
! gyp ERR! System Windows_NT 6.1.7601
! gyp ERR! command "C:\Users\awarner\AppData\Local\particle\node-v8.15.0-windows-x64\bin\node.exe" "C:\Users\awarner\AppData\Local\particle\node-v8.15.0-windows-x64\lib\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
! gyp ERR! cwd C:\Users\awarner\AppData\Local\particle\node_modules\serialport
! gyp ERR! node -v v8.15.0
! gyp ERR! node-gyp -v v3.8.0
! gyp ERR! not ok
! npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\awarner\AppData\Local\particle\package.json'
! npm WARN particle No description
! npm WARN particle No repository field.
! npm WARN particle No README data
! npm WARN particle No license field.
!
! npm ERR! code ELIFECYCLE
! npm ERR! errno 1
! npm ERR! serialport@6.2.0 install: prebuild-install || node-gyp rebuild
! npm ERR! Exit status 1
! npm ERR!
! npm ERR! Failed at the serialport@6.2.0 install script.
! npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
!
! npm ERR! A complete log of this run can be found in:
! npm ERR! C:\Users\awarner\AppData\Local\particle.npm-cache_logs\2019-02-22T00_45_20_587Z-debug.log
!
! Try running again with GODE_DEBUG=info to see more output.
Error: Command failed: C:\Users\awarner.vscode\extensions\particle.particle-vscode-core-1.2.2\src\cli\bin\windows\amd64\particle.exe version
particle: Installing plugins...npm ERR! As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead. On the other hand, if you're debugging an issue with the installer, you can use npm install --cache /tmp/empty-cache to use a temporary cache instead of nuking the actual one.
npm ERR!
npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\awarner\AppData\Local\particle.npm-cache_logs\2019-02-22T00_44_50_440Z-debug.log

! exit status 1

particle: Installing plugins (retrying)...
! Error installing package.
! 'prebuild-install' is not recognized as an internal or external command,
! operable program or batch file.
! gyp ERR! build error
! gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1
! gyp ERR! stack at ChildProcess.onExit (C:\Users\awarner\AppData\Local\particle\node-v8.15.0-windows-x64\lib\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
! gyp ERR! stack at emitTwo (events.js:126:13)
! gyp ERR! stack at ChildProcess.emit (events.js:214:7)
! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
! gyp ERR! System Windows_NT 6.1.7601
! gyp ERR! command "C:\Users\awarner\AppData\Local\particle\node-v8.15.0-windows-x64\bin\node.exe" "C:\Users\awarner\AppData\Local\particle\node-v8.15.0-windows-x64\lib\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
! gyp ERR! cwd C:\Users\awarner\AppData\Local\particle\node_modules\serialport
! gyp ERR! node -v v8.15.0
! gyp ERR! node-gyp -v v3.8.0
! gyp ERR! not ok
! npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\awarner\AppData\Local\particle\package.json'
! npm WARN particle No description
! npm WARN particle No repository field.
! npm WARN particle No README data
! npm WARN particle No license field.
!
! npm ERR! code ELIFECYCLE
! npm ERR! errno 1
! npm ERR! serialport@6.2.0 install: prebuild-install || node-gyp rebuild
! npm ERR! Exit status 1
! npm ERR!
! npm ERR! Failed at the serialport@6.2.0 install script.
! npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
!
! npm ERR! A complete log of this run can be found in:
! npm ERR! C:\Users\awarner\AppData\Local\particle.npm-cache_logs\2019-02-22T00_45_20_587Z-debug.log
!
! Try running again with GODE_DEBUG=info to see more output.

at makeError (C:\Users\awarner.vscode\extensions\particle.particle-vscode-core-1.2.2\node_modules\execa\index.js:174:9)
at module.exports.Promise.all.then.arr (C:\Users\awarner.vscode\extensions\particle.particle-vscode-core-1.2.2\node_modules\execa\index.js:278:16)


Particle: Audit Environment output:

{
    "username": null,
    "workspace": {
        "name": "",
        "isWorkspace": false,
        "folders": []
    },
    "cli": {
        "binpath": "C:\\Users\\awarner\\.vscode\\extensions\\particle.particle-vscode-core-1.2.2\\src\\cli\\bin\\windows\\amd64\\particle.exe",
        "ok": false,
        "version": null
    },
    "localCompiler": {
        "dependencies": [
            "deviceOS@1.0.1",
            "gcc-arm@5.3.1",
            "buildtools@1.0.1",
            "buildscripts@1.2.0",
            "openocd@0.10.0-particle.1"
        ]
    },
    "platform": {
        "os": "windows",
        "type": "Windows_NT",
        "release": "6.1.7601",
        "arch": "x64",
        "path": {
            "key": "Path",
            "value": "C:\\ProgramData\\Oracle\\Java\\javapath;C:\\Program Files (x86)\\Common Files\\Intel\\Shared Libraries\\redist\\ia32\\mpirt;C:\\Program Files (x86)\\Common Files\\Intel\\Shared Libraries\\redist\\ia32\\compiler;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Common Files\\Roxio Shared\\9.0\\DLLShared\\;C:\\Program Files (x86)\\Common Files\\Roxio Shared\\DLLShared\\;C:\\Program Files (x86)\\IVI Foundation\\VISA\\WinNT\\Bin;%JAVA_HOME%\\bin;%JAVA_HOME%\\jre\\bin\\client;C:\\Program Files (x86)\\Skype\\Phone\\;C:\\Program Files (x86)\\Pico Technology\\PicoScope6\\;C:\\Program Files\\Microsoft VS Code\\bin;C:\\Users\\awarner\\AppData\\Local\\Continuum\\Anaconda2;C:\\Users\\awarner\\AppData\\Local\\Continuum\\Anaconda2\\Scripts;C:\\Users\\awarner\\AppData\\Local\\Continuum\\Anaconda2\\Library\\bin;C:\\Users\\awarner\\AppData\\Local\\atom\\bin"
        },
        "homeDir": "C:\\Users\\awarner",
        "particleDir": "C:\\Users\\awarner\\.particle",
        "localCompilerToolchainDir": "C:\\Users\\awarner\\.particle\\toolchains"
    },
    "env": {
     [ chop chop chop, let me know if you need something from here]
        "VSCODE_CWD": "C:\\Program Files\\Microsoft VS Code",
        "VSCODE_HANDLES_UNCAUGHT_ERRORS": "true",
        "VSCODE_IPC_HOOK": "\\\\.\\pipe\\01f189c1116e418b9c07a952665eea3a-1.31.1-main-sock",
        "VSCODE_IPC_HOOK_EXTHOST": "\\\\.\\pipe\\vscode-ipc-ce378878-201a-4a47-a950-de58b1fb83bd-sock",
        "VSCODE_LOGS": "C:\\Users\\awarner\\AppData\\Roaming\\Code\\logs\\20190221T184351",
        "VSCODE_LOG_STACK": "false",
        "VSCODE_NLS_CONFIG": "{\"locale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}",
        "VSCODE_NODE_CACHED_DATA_DIR": "C:\\Users\\awarner\\AppData\\Roaming\\Code\\CachedData\\1b8e8302e405050205e69b59abb3559592bb9e60",
        "VSCODE_PID": "7492",
        "VSCODE_PREVENT_FOREIGN_INSPECT": "true",
        "VSEDEFLOGDIR": "C:\\ProgramData\\McAfee\\DesktopProtection",
        "VXIPNPPATH": "C:\\Program Files (x86)\\IVI Foundation\\VISA\\",
        "windir": "C:\\Windows"
    },
    "versions": {
        "http_parser": "2.8.0",
        "node": "10.2.0",
        "v8": "6.6.346.32",
        "uv": "1.20.3",
        "zlib": "1.2.11",
        "ares": "1.14.0",
        "modules": "64",
        "nghttp2": "1.29.0",
        "napi": "3",
        "openssl": "1.1.0h"
    },
    "vscode": {
        "appName": "Visual Studio Code",
        "appRoot": "c:\\Program Files\\Microsoft VS Code\\resources\\app",
        "machineId": "a19766bb-78e1-4053-baa7-1cf74dcfeb8d",
        "sessionId": "132e2f27-3e05-4d83-8256-8344e50e64a11550796232415",
        "version": "1.31.1"
    },
    "extensions": [
        {
            "id": "ms-vscode.node-debug",
            "version": "1.31.2"
        },
        {
            "id": "ms-vscode.node-debug2",
            "version": "1.31.6"
        },
        {
            "id": "ms-vscode.references-view",
            "version": "0.0.24"
        },
        {
            "id": "Ikuyadeu.r",
            "version": "1.0.3"
        },
        {
            "id": "marus25.cortex-debug",
            "version": "0.2.3"
        },
        {
            "id": "ms-python.python",
            "version": "2019.1.0"
        },
        {
            "id": "ms-vscode.cpptools",
            "version": "0.21.0"
        },
        {
            "id": "ms-vscode.Go",
            "version": "0.9.2"
        },
        {
            "id": "particle.particle-vscode-core",
            "version": "1.2.2"
        },
        {
            "id": "particle.particle-vscode-pack",
            "version": "1.2.2"
        },
        {
            "id": "particle.particle-vscode-snippets",
            "version": "1.2.2"
        },
        {
            "id": "particle.particle-vscode-theme",
            "version": "1.2.2"
        }
    ]
}
1 Like

ick. that’s no fun. sorry about that. did you have the Particle CLI installed stand-alone before installing Workbench? if so, try the fixes suggested over here: Information: Particle CLI Wrapper `v1.0.0` Update

Honestly have no idea if the CLI was previously installed on that machine, if it was, it was long time ago. I will try the fixes you link to. Are you planning to fix the root cause, so others don’t have to search for this thread ?

In other news, the linux install appears to have gone swimmingly - and that is my preferred workstation.

2 Likes

Sorry you had to go through this Andy. I suspect a remnant of an old version of the CLI caused the issue. Deleting C:\Users\<you>\AppData\Local\particle and opening Workbench again should get you back in the right place.

I like that possible fix better - will try it and see.

Mostly, I’m OK with whatever manual steps I personally need to take - mostly I just want to make sure the failure mode is captured and fixed.

I can confirm that blowing away C:\Users\<you>\AppData\Local\particle allows the subsequent CLI dependency installation to complete.

Showing my mastery of the obvious, may I suggest that the installation process perform this step, or something similar, to avoid this in future.

1 Like

I was also having trouble installing Workbench related to a error installing the CLI. Something about “version” command not found. I wiped out the appdata folder that jvanier suggested, reinstalled, and it’s working now.

Tom

I am currently experiencing this issue again (started perhaps about two weeks ago), but with the difference that deleting the particle folder in AppData\Local does not fix it. Any suggestions? (Workbench had been installed successfully before.)

Thanks!

I never got it to install and work. uninstalled it.

Hello there! A student here trying to install CLI for particle workbench and i'm getting a similar npm error but I am at a lost on what to do. I am also getting a similar error when installing CLI

Installing plugins...npm ERR! As of npm@5, the npm cache self-heals from corruption issues
npm ERR! by treating integrity mismatches as cache misses. As a result,
npm ERR! data extracted from the cache is guaranteed to be valid. If you
npm ERR! want to make sure everything is consistent, use npm cache verify
npm ERR! instead. Deleting the cache can only make npm go slower, and is
npm ERR! not likely to correct any problems you may be encountering!
npm ERR!
npm ERR! On the other hand, if you're debugging an issue with the installer,
npm ERR! or race conditions that depend on the timing of writing to an empty
npm ERR! cache, you can use npm install --cache /tmp/empty-cache to use a
npm ERR! temporary cache instead of nuking the actual one.
npm ERR!
npm ERR! If you're sure you want to delete the entire cache, rerun this command
npm ERR! with --force.

npm ERR! A complete log of this run can be found in:
npm ERR!

â–¸ exit status 1
But the information below I cant really decipher.

particle: Installing plugins (retrying)...
â–¸ Error installing package.
â–¸ npm WARN using --force Recommended protections disabled.
â–¸ npm WARN deprecated set-value@0.4.3: Critical bug fixed in v3.0.1, please upgrade to the latest version.
â–¸ npm WARN deprecated set-value@2.0.0: Critical bug fixed in v3.0.1, please upgrade to the latest version.
npm WARN deprecated mixin-deep@1.3.1: Critical bug fixed in v2.0.1, please upgrade to the latest version.
â–¸ npm WARN deprecated ini@1.3.4: Please update to ini >=1.3.6 to avoid a prototype pollution issue

(it goes on about how a deprecation notice)

When I did an audit I got this:

"cli": {
"binpath": "/Users/hannahmu/.vscode/extensions/particle.particle-vscode-core-1.16.9/src/cli/bin/darwin/amd64/particle",
"ok": true,
"version": "particle: Installing plugins...npm ERR! As of npm@5, the npm cache self-heals from corruption issues\nnpm ERR! by treating integrity mismatches as cache misses. As a result,\nnpm ERR! data extracted from the cache is guaranteed to be valid. If you\nnpm ERR! want to make sure everything is consistent, use npm cache verify\nnpm ERR! instead. Deleting the cache can only make npm go slower, and is\nnpm ERR! not likely to correct any problems you may be encountering!\nnpm ERR! \nnpm ERR! On the other hand, if you're debugging an issue with the installer,\nnpm ERR! or race conditions that depend on the timing of writing to an empty\nnpm ERR! cache, you can use npm install --cache /tmp/empty-cache to use a\nnpm ERR! temporary cache instead of nuking the actual one.\nnpm ERR! \nnpm ERR! If you're sure you want to delete the entire cache, rerun this command\nnpm ERR! with --force.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR! /Users/hannahmu/.particle/.npm-cache/_logs/2023-09-19T14_42_42_820Z-debug-0.log\n\n â–¸ exit status 1\n\rparticle: Installing plugins (retrying)...\n â–¸ Error installing package. \n â–¸ npm WARN using --force Recommended protections disabled.\n â–¸ npm WARN deprecated set-value@0.4.3: Critical bug fixed in v3.0.1, please upgrade to the latest version.\n â–¸ npm WARN deprecated set-value@2.0.0: Critical bug fixed in v3.0.1, please upgrade to the latest version.\n (it goes on again about how a deprecation notice)

I'm kind of at a lost on what to do.