Hi all,
We're updating the installer for the Particle CLI (Command Line Interface) to run using Node 16.
As long as you've installed the CLI using the installer, the next time you run the CLI, it will update to Node 16 in the background. You can trigger the upgrade in the foreground by running particle update-cli
If some CLI commands don't work after the upgrade, follow the steps in the CLI troubleshooting guide.
Open the directory containing the CLI’s files:
- Mac OS / Linux:
~/.particle
- Windows:
C:\Users\<your username>\AppData\Local\particle
Delete the following files and directories if available:
.npm-cache
autoupdate
error.log
-
node-v<version>-<os>-<cpu>
- (e.g.
node-v16.20.0-windows-x64, node-v16.20.0-darwin-x64, node-v16.20.0-linux-x64
)
node_modules
package.json
package-lock.json
plugin-cache.json
profile.json
tmp
Run the update command
If you installed the CLI manually using npm, we recommend that you upgrade to running it using Node 16, although Node 12 will still work.
2 Likes
@jvanier, even though I have never had problems running particle update-cli
, today the update did not go so well (Win 10x64, CLI installed with Windows installer). I ended up having to Ctrl-C at then end as it was stuck. I will most likely uninstall and reinstall with latest Windows installer.
C:\SPARK\TESTING>particle update-cli
Updating Particle CLI to 1.2.0-faae627 (master)... done
particle: Adding dependencies...
! Error rebuilding packages.
! npm notice
! npm notice New major version of npm available! 8.19.4 -> 9.6.6
! npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.6.6>
! npm notice Run `npm install -g npm@9.6.6` to update!
! npm notice
! npm ERR! code 1
! npm ERR! path C:\Users\Paul\AppData\Local\particle\node_modules\particle-cli\node_modules\@serialport\bindings
! npm ERR! command failed
! npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
! npm ERR! prebuild-install WARN install No prebuilt binaries found (target=16.20.0 runtime=node arch=x64 libc= platform=win32)
! npm ERR! gyp info it worked if it ends with ok
! npm ERR! gyp info using node-gyp@9.1.0
! npm ERR! gyp info using node@16.20.0 | win32 | x64
! npm ERR! gyp info find Python using Python version 3.9.6 found at "C:\Program Files\Python39\python.exe"
! npm ERR! gyp http GET https://nodejs.org/download/release/v16.20.0/node-v16.20.0-headers.tar.gz
! npm ERR! gyp http 200 https://nodejs.org/download/release/v16.20.0/node-v16.20.0-headers.tar.gz
! npm ERR! gyp http GET https://nodejs.org/download/release/v16.20.0/SHASUMS256.txt
! npm ERR! gyp http GET https://nodejs.org/download/release/v16.20.0/win-x64/node.lib
! npm ERR! gyp http GET https://nodejs.org/download/release/v16.20.0/win-x86/node.lib
! npm ERR! gyp http GET https://nodejs.org/download/release/v16.20.0/win-arm64/node.lib
! npm ERR! gyp http 200 https://nodejs.org/download/release/v16.20.0/SHASUMS256.txt
! npm ERR! gyp http 200 https://nodejs.org/download/release/v16.20.0/win-x64/node.lib
! npm ERR! gyp http 200 https://nodejs.org/download/release/v16.20.0/win-x86/node.lib
! npm ERR! gyp http 404 https://nodejs.org/download/release/v16.20.0/win-arm64/node.lib
! npm ERR! gyp ERR! find VS
! npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
! npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
! npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
! npm ERR! gyp ERR! find VS looking for Visual Studio 2015
! npm ERR! gyp ERR! find VS - not found
! npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
! npm ERR! gyp ERR! find VS
! npm ERR! gyp ERR! find VS **************************************************************
! npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
! npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
! npm ERR! gyp ERR! find VS For more information consult the documentation at:
! npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
! npm ERR! gyp ERR! find VS **************************************************************
! npm ERR! gyp ERR! find VS
! npm ERR! gyp ERR! configure error
! npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
! npm ERR! gyp ERR! stack at VisualStudioFinder.fail (C:\Users\Paul\AppData\Local\particle\node-v16.20.0-windows-x64\lib\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:122:47)
! npm ERR! gyp ERR! stack at C:\Users\Paul\AppData\Local\particle\node-v16.20.0-windows-x64\lib\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:75:16
! npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\Paul\AppData\Local\particle\node-v16.20.0-windows-x64\lib\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:364:14)
! npm ERR! gyp ERR! stack at C:\Users\Paul\AppData\Local\particle\node-v16.20.0-windows-x64\lib\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:71:14
! npm ERR! gyp ERR! stack at C:\Users\Paul\AppData\Local\particle\node-v16.20.0-windows-x64\lib\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:385:16
! npm ERR! gyp ERR! stack at C:\Users\Paul\AppData\Local\particle\node-v16.20.0-windows-x64\lib\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
! npm ERR! gyp ERR! stack at C:\Users\Paul\AppData\Local\particle\node-v16.20.0-windows-x64\lib\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
! npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:410:5)
! npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
! npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1100:16)
! npm ERR! gyp ERR! System Windows_NT 10.0.19045
! npm ERR! gyp ERR! command "C:\\Users\\Paul\\AppData\\Local\\particle\\node-v16.20.0-windows-x64\\bin\\node.exe" "C:\\Users\\Paul\\AppData\\Local\\particle\\node-v16.20.0-windows-x64\\lib\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
! npm ERR! gyp ERR! cwd C:\Users\Paul\AppData\Local\particle\node_modules\particle-cli\node_modules\@serialport\bindings
! npm ERR! gyp ERR! node -v v16.20.0
! npm ERR! gyp ERR! node-gyp -v v9.1.0
! npm ERR! gyp ERR! not ok
!
! npm ERR! A complete log of this run can be found in:
! npm ERR! C:\Users\Paul\AppData\Local\particle\.npm-cache\_logs\2023-05-10T16_07_56_186Z-debug-0.log
!
! Try running again with GODE_DEBUG=info to see more output.
done
particle: Installing plugins...
Timed out while updating
UPDATE: Uninstalling CLI and reinstalling with latest Windows installer worked, with Node 16 installed as expected.
2 Likes
Thanks for the feedback. We released CLI 3.10.0 on Monday which has modules precompiled for Node 12 and 16. I bet what happened is that your computer was still on CLI 3.9.0 with has modules precompiled for Node 8 and 12 so the update had an issue when it ran npm rebuild
. Running particle update-cli
a second time may have fixed it, but uninstalling and reinstalling is also a good option.
1 Like
I have tried to install Workbench inside VS Code. It would not work at all. It took hours sitting there with something like "Updating CLI" with no progress or feedback. When it finished I tried to log in.
I tried various things and got several error messages. The common one was "
! exec: "C:\Users\rlkei\AppData\Local\particle\node-v16.20.0-windows-x64\bin\node.exe": file does not exist
particle: Installing plugins (retrying)...
! Error installing package."
I followed the instructions above, then used the CLI Installer. I checked that the file Local\particle\node-v16.20.0-windows-x64\bin\node.exe was present. It was. Then I ran particle update-cli from the command line.
I got the same error. I checked for the presence of the node.exe file and it had been deleted. The folder node-v16.20.0-windows-x64 was completely empty.
I just want the Particle Workbench working. How hard can it be? I have been trying all afternoon.
Rob
As a last resort I dusted off the Mac. I got workbench working on that so I can continue work for now.
I uninstall Node and reinstall it on Mac https://nodejs.org/en , then it works. I don't know it works on Windows.