Can't install particle CLI in windows

Hi,

I need your help.

I am trying to install particle Cli in windows 10 and it shows me the following using the installer:

Output folder: C:\Users\aquil\AppData\Local\particle
Downloading build information
Create folder: C:\Users\aquil\AppData\Local\particle\bin
Downloading CLI executable
Rename: C:\Users\aquil\AppData\Local\Temp\nse8598.tmp->C:\Users\aquil\AppData\Local\particle\bin\particle.exe
Downloading and installing CLI dependencies. This may take several minutes...
particle: Adding dependencies... done
particle: Installing plugins...
_ ! Error reading plugin: particle-cli_
_ ! exit status 1_
_ ! module.js:327_
_ ! throw err;_
_ ! ^_
_ ! _
_ ! Error: Cannot find module 'particle-cli/package.json'_
_ ! at Function.Module.resolveFilename (module.js:325:15)
_ ! at Function.Module.load (module.js:276:25)
_ ! at Module.require (module.js:353:17)_
_ ! at require (internal/module.js:12:17)_
_ ! at [eval]:3:15_
_ ! at Object.exports.runInThisContext (vm.js:54:17)_
_ ! at Object. ([eval]-wrapper:6:22)_
_ ! at Module.compile (module.js:397:26)
_ ! at node.js:611:27_
_ ! at nextTickCallbackWith0Args (node.js:452:9)_
Output folder: C:\Users\aquil\AppData\Local\particle\bin
Extract: dfu-prefix.exe... 100%
Extract: dfu-suffix.exe... 100%
Extract: dfu-util-static.exe... 100%
Extract: dfu-util.exe... 100%
Extract: libusb-1.0.dll... 100%
Output folder: C:\Users\aquil\AppData\Local\particle
Adding CLI to path
Add to PATH: C:\Users\aquil\AppData\Local\particle\bin
Extract: C:\Users\aquil\AppData\Local\Temp\ParticleDriversSetup.exe... 100%
Installing USB drivers
ExecShell: C:\Users\aquil\AppData\Local\Temp\ParticleDriversSetup.exe
Downloading OpenSSL
Installing OpenSSL
Created uninstaller: C:\Users\aquil\AppData\Local\particle\Uninstall.exe

Run "particle setup" in the command line to start using the Particle CLIline to start using the Particle CLI

When I try to execute it, I mark this error.

ph

I tried in 3 computers: 2 with windows 10 and one with windows 7 and in all that it marks that error.

Could you help me? :disappointed_relieved:

Thanks

How was installed the particle-cli? Perhaps that would be a permission/scope issue.

Hi,

Using the ā€œParticle CLIā€ installer I run it as administrator.

That means that you didnā€™t do

npm install -g particle-cli

?

yes but it marks me errors.

Iā€™m not a wondows user so as far as I see, this solve (workaround) the self signed cert isue

SETLOCAL
SET npm_config_strict-ssl=false
npm install npm -g --ca=null
npm --version
npm install -g particle-cli
ENDLOCAL

Have you downloaded the most recent Windows CLI Installer?
Particle had some issues a few days back with Windows installations/updates which should have been fixed.
If the issue persists with the most recent installer, we may need to ping someone.

Under Windows the use of npm install is not encouraged anymore due to frequent dependency issues, this is why the installer was created to prevent such things from happening.

1 Like

Download the Windows CLI Installer and run it to install the Particle CLI, the device drivers and the dependencies that the CLI needs.

Youā€™ll need to open the command prompt for this next part. You can also use Powershell or a similar command line tool if that is what you are used to.

Windows CLI Installer :- https://binaries.particle.io/cli/installer/windows/ParticleCLISetup.exe

Hi,

I already installed the version of the link that @Salmanfarisvp put.

But I still have problems, I tried again in 2 PC's, one with node installed and another without it.

In the computer that has node it marked these errors.

Output folder: C:\Users\aquil\AppData\Local\particle
Downloading build information
Create folder: C:\Users\aquil\AppData\Local\particle\bin
Downloading CLI executable
Rename: C:\Users\aquil\AppData\Local\Temp\nsmD4B4.tmp->C:\Users\aquil\AppData\Local\particle\bin\particle.exe
Downloading and installing CLI dependencies. This may take several minutes...
particle: Adding dependencies... done
particle: Adding dependencies... done
particle: Installing plugins...
! module.js:327
! throw err;
! ^
!
! Error: Cannot find module 'C:\Users\aquil\AppData\Local\particle\node-v5.4.1-windows-x64\lib\node_modules\npm\cli.js'
! at Function.Module._resolveFilename (module.js:325:15)
! at Function.Module._load (module.js:276:25)
! at Function.Module.runMain (module.js:429:10)
! at startup (node.js:139:18)
! at node.js:999:3
module.js:327
throw err;
^

Error: Cannot find module 'C:\Users\aquil\AppData\Local\particle\node-v5.4.1-windows-x64\lib\node_modules\npm\cli.js'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Function.Module.runMain (module.js:429:10)
at startup (node.js:139:18)
at node.js:999:3

! exit status 1

! Error installing package.
! module.js:327
! throw err;
! ^
!
! Error: Cannot find module 'C:\Users\aquil\AppData\Local\particle\node-v5.4.1-windows-x64\lib\node_modules\npm\cli.js'
! at Function.Module._resolveFilename (module.js:325:15)
! at Function.Module._load (module.js:276:25)
! at Function.Module.runMain (module.js:429:10)
! at startup (node.js:139:18)
! at node.js:999:3
!
! Try running again with GODE_DEBUG=info to see more output.
Output folder: C:\Users\aquil\AppData\Local\particle\bin
Extract: dfu-prefix.exe... 100%
Extract: dfu-suffix.exe... 100%
Extract: dfu-util-static.exe... 100%
Extract: dfu-util.exe... 100%
Extract: libusb-1.0.dll... 100%
Output folder: C:\Users\aquil\AppData\Local\particle
Adding CLI to path
Add to PATH: C:\Users\aquil\AppData\Local\particle\bin
Extract: C:\Users\aquil\AppData\Local\Temp\ParticleDriversSetup.exe... 100%
Installing USB drivers
ExecShell: C:\Users\aquil\AppData\Local\Temp\ParticleDriversSetup.exe
Downloading OpenSSL
Installing OpenSSL
Created uninstaller: C:\Users\aquil\AppData\Local\particle\Uninstall.exe

Run "particle setup" in the command line to start using the Particle CLI

in the other, it shows me the same mistakes of my first post.

Any Idea? :sleepy:

We can ping @jvanier who is in charge of CLI Installer

I raised a issue in github :- https://github.com/particle-iot/particle-cli/issues/439

1 Like

Did the suggestion given in the issue reply help?

I already tested it and it gives me the same output as @ Salmanfarisvp.

Captura

After that, I tried to install it again but the error is the same.

I try to figure out why this happens but I donā€™t even know where to start :sweat_smile:

Iā€™m having a very similar issue, on Windows 7 32-bit.

I previously had a working CLI-Installer based installation (1.27.0). I tried upgrading it with particle update-cli command and it continually timed-out. Following a suggestion in another thread, I de-installed and have now re-installed using the latest available CLI Installer.

There is no npm global installation present (removed a long time ago).

Installation was done running the CLI Installer as Administrator. It downloaded and ran for an age, then failed in the middle with the same error the OP posted above. It then continued to install the DFU util stuff and finished.

When I try and run particle setup in an Administrator privilege CMD window, I get the following response. I have now tried multiple install/de-install cycles, PC restarts, and also repeated running of the command below in case it is a transient network issue. Note that I can download the package using the URL referenced in the package.json file (which exists in %LOCALAPPDATA%/particle/.npm-cache/particle-cli/1.33.0/package directory).

I donā€™t know where to go with this, nowā€¦ I no longer have a working CLI and therefore cannot work on my Electron kitā€¦ Is there an installer bug thatā€™s going to be fixed soon, perhaps?

C:\Users\apt\AppData\Local>particle setup
particle: Installing plugins (retrying)...
 !    Error reading plugin: particle-cli
 !    exit status 1
 !    module.js:327
 !        throw err;
 !        ^
 !
 !    Error: Cannot find module 'particle-cli/package.json'
 !        at Function.Module._resolveFilename (module.js:325:15)
 !        at Function.Module._load (module.js:276:25)
 !        at Module.require (module.js:353:17)
 !        at require (internal/module.js:12:17)
 !        at [eval]:3:15
 !        at Object.exports.runInThisContext (vm.js:54:17)
 !        at Object.<anonymous> ([eval]-wrapper:6:22)
 !        at Module._compile (module.js:397:26)
 !        at node.js:611:27
 !        at nextTickCallbackWith0Args (node.js:452:9)

Any assistance welcome. Other similar scenarios recorded in the forums seem to spontaneously fix themselves, but this magic isnā€™t happening for me. :frowning:

Edit: Added history of latest install plus setup attempt, per %LOCALAPPDATA%/particle/error.log file:

2018/08/28 22:03:58 Manifest version 0.3.3-d3120d4, Installed version 0.3.3-d3120d4
2018/08/28 22:03:58 particle: Adding dependencies...
2018/08/28 22:04:07  done
2018/08/28 22:04:07 particle: Installing plugins...
2018/08/28 22:14:16 particle: Installing plugins (retrying)...
2018/08/28 22:24:20 
2018/08/28 22:24:20  !    Error reading plugin: particle-cli
 !    exit status 1
 !    module.js:327
 !        throw err;
 !        ^
 !    
 !    Error: Cannot find module 'particle-cli/package.json'
 !        at Function.Module._resolveFilename (module.js:325:15)
 !        at Function.Module._load (module.js:276:25)
 !        at Module.require (module.js:353:17)
 !        at require (internal/module.js:12:17)
 !        at [eval]:3:15
 !        at Object.exports.runInThisContext (vm.js:54:17)
 !        at Object.<anonymous> ([eval]-wrapper:6:22)
 !        at Module._compile (module.js:397:26)
 !        at node.js:611:27
 !        at nextTickCallbackWith0Args (node.js:452:9)
2018/08/28 23:11:56 Time since last update 1h7m59.4974071s, update in block
2018/08/28 23:11:56 particle: Installing plugins...
2018/08/28 23:21:48 
2018/08/28 23:21:48  !    exit status -4048
2018/08/28 23:21:48 particle: Installing plugins (retrying)...
2018/08/28 23:31:49 
2018/08/28 23:31:49  !    Error reading plugin: particle-cli
 !    exit status 1
 !    module.js:327
 !        throw err;
 !        ^
 !    
 !    Error: Cannot find module 'particle-cli/package.json'
 !        at Function.Module._resolveFilename (module.js:325:15)
 !        at Function.Module._load (module.js:276:25)
 !        at Module.require (module.js:353:17)
 !        at require (internal/module.js:12:17)
 !        at [eval]:3:15
 !        at Object.exports.runInThisContext (vm.js:54:17)
 !        at Object.<anonymous> ([eval]-wrapper:6:22)
 !        at Module._compile (module.js:397:26)
 !        at node.js:611:27
 !        at nextTickCallbackWith0Args (node.js:452:9)

Latest on the sagaā€¦ occasionally this pattern pops up. It implies that the process is having trouble with ā€˜lstatā€™ against a directory, but this is in a CMD shell window started run-as Administrator. There is no higher authority that I know of?

C:\Users\apt\AppData\Local>particle
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Users\\apt\\AppData\\Local\\particle\\node-v5.4.1-windows-x86\\bin\\node.exe" "C:\\Users\\apt\\AppData\\Local\\particle\\node-v5.4.
1-windows-x86\\lib\\node_modules\\npm\\cli.js" "cache" "clean"
npm ERR! node v5.4.1
npm ERR! npm  v3.3.10
npm ERR! path C:\Users\apt\AppData\Local\particle\.npm-cache
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall lstat

npm ERR! Error: EPERM: operation not permitted, lstat 'C:\Users\apt\AppData\Local\particle\.npm-cache'
npm ERR!     at Error (native)
npm ERR!  { [Error: EPERM: operation not permitted, lstat 'C:\Users\apt\AppData\Local\particle\.npm-cache']
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'lstat',
npm ERR!   path: 'C:\\Users\\apt\\AppData\\Local\\particle\\.npm-cache' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\apt\AppData\Local\particle\npm-debug.log

 !    exit status -4048
particle: Installing plugins (retrying)...

Some potentially related information (per https://github.com/developit/preact-cli/issues/304 comments) - node 5.4.1 appears to have occasional issues like this. Per the link, downgrading to 5.0.3 makes them go away. Or - maybe - upgrading to 5.6.0.

Is there any possibility/timeline for this being done in the CLI installer (uses 5.4.1)?

Okā€¦ well, itā€™s resolved.

After reading other web resources dealing with npm bugs and behaviours, it appears npm is very sensitive to file/directory usage/locks in Windows. The only thing I could determine that would be concurrently trying to access brand-new files/directories created during the installation was the Kaspersky IS tool. I had previously disabled its File AV and other components that appeared likely to be sticking their fingers into the particle pie, without success. In the end I had to disable it entirely on startup, restart the machine, and then re-install Particle CLI.

It all went smoothly, at last.

Anywayā€¦ lesson learned. And this thread may help some other poor unfortunate confronted by the gaps in Particle CLI installation instructions.

Now, I can do some more productive workā€¦ :slight_smile:

3 Likes

I chose to give up on Windows. I have been working on Ubuntu and it works without any problem :sweat_smile:

1 Like

Sorry for all of the difficulties. I had not heard of that interaction before, but thank you for figuring it out. Iā€™ll add that to our support resources so the process wonā€™t be so painful the next time it happens. Thank you for sticking with it to find a solution!

2 Likes

The gist of the node/npm discussions seems to be that nodejs is written originally for a *nix world, and its filesystem rules, and some of its OS calls assume behaviour thatā€™s not consistent with Windows OS file locking/flags.

So most of the EPERM type errors are not in fact anything to do with privileges on the file/directory, but an imperfect response to being told by Windows that some other process (or, indeed, another thread of the same node/npm process) is interested in the file/directory (so donā€™t delete it, for example). A retry operation would be a more appropriate handler in most cases (race conditions are an issue, too, in some node versions). Add an AV scanner to the mix, looking for new/changed files, and itā€™s a recipe for pain.

The versions of node and npm used in the installer are quite old, so this issue may have been fixed in contemporary versionsā€¦ but Iā€™ve never played with either, outside of their use in the particle cli, so thatā€™s the limit of what I know!

1 Like