"npm install -g particle-cli" Failing (Windows)

So following the official documentation here (for Windows)

https://docs.particle.io/guide/getting-started/connect/photon/

I get to the npm install option and get the following errors (at end of post)

I tried installing git but this doesn’t seem to resolve it? I am obviously doing something incredibly stupid just need to work out what it is.


C:\Users\Phoenix>npm install -g particle-cli
npm ERR! git clone --template=C:\Users\Phoenix\AppData\Roaming\npm-cache_git-remotes_templates --mirror https://github.com/rynomad/jsbn.git C:\Users\Phoenix\AppData\Roaming\npm-cache_git-remotes\git-https-github-com-rynomad-jsbn-git-5eacfb5ecac35cf3eb2fc8aac95d0469: undefined
npm ERR! git clone --template=C:\Users\Phoenix\AppData\Roaming\npm-cache_git-remotes_templates --mirror https://github.com/rynomad/jsbn.git C:\Users\Phoenix\AppData\Roaming\npm-cache_git-remotes\git-https-github-com-rynomad-jsbn-git-5eac
fb5ecac35cf3eb2fc8aac95d0469: undefined
npm WARN install Couldn’t install optional dependency: not found: git
npm WARN addRemoteGit Error: not found: git
npm WARN addRemoteGit at F (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:78:19)
npm WARN addRemoteGit at E (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:82:29)
npm WARN addRemoteGit at C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:93:16
npm WARN addRemoteGit at FSReqWrap.oncomplete (fs.js:82:15)
npm WARN addRemoteGit jacobrosenthal/node-pre-gyp-github#production resetting remote C:\Users\Phoenix\AppData\Roaming\npm-cache_git-remotes\git-github-com-jacobrosenthal-node-pre-gyp-github-git-production-00f1b2658a8ab0261b1b6e8aa994ae37 because of error: { [Error: not found: git] code: β€˜ENOGIT’ }
npm ERR! git clone --template=C:\Users\Phoenix\AppData\Roaming\npm-cache_git-remotes_templates --mirror git://github.com/jacobrosenthal/node-pre-gyp-github.git C:\Users\Phoenix\AppData\Roaming\npm-cache_git-remotes\git-github-com-jacobro
senthal-node-pre-gyp-github-git-production-00f1b2658a8ab0261b1b6e8aa994ae37: undefined
npm ERR! git clone --template=C:\Users\Phoenix\AppData\Roaming\npm-cache_git-remotes_templates --mirror git://github.com/jacobrosenthal/node-pre-gyp-github.git C:\Users\Phoenix\AppData\Roaming\npm-cache_git-remotes\git-github-com-jacobrosenthal-node-pre-gyp-github-git-production-00f1b2658a8ab0261b1b6e8aa994ae37: undefined
npm WARN addRemoteGit Error: not found: git
npm WARN addRemoteGit at F (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:78:19)
npm WARN addRemoteGit at E (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:82:29)
npm WARN addRemoteGit at C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:93:16
npm WARN addRemoteGit at FSReqWrap.oncomplete (fs.js:82:15)
npm WARN addRemoteGit jacobrosenthal/node-pre-gyp-github#production resetting remote C:\Users\Phoenix\AppData\Roaming\npm-cache_git-remotes\git-https-github-c
om-jacobrosenthal-node-pre-gyp-github-git-production-1e8dd7eab6415a0b31fc9e88e23213e9 because of error: { [Error: not found: git] code: β€˜ENOGIT’ }
npm ERR! git clone --template=C:\Users\Phoenix\AppData\Roaming\npm-cache_git-remotes_templates --mirror https://github.com/jacobrosenthal/node-pre-gyp-github.

resolved it with adding git to the path and renaming the binary from git-cmd.exe to git.exe

PATH=%PATH%;C:\Users\Phoenix\AppData\Local\Programs\Git

Scratch that it gets stuck here.

C:\Users\Phoenix>npm install -g particle-cli
loadDep:jsbn β†’ git β–ˆ β•£β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β• 

Any ideas?

It has been like that for about 15 minutes.

@phoenixdigital,

just wondering if you are still having issues? :smiley:

1 Like

I have the same issue. Windows 8.1 fully updated, Git was installed and everything else installed OK, but this blew up.

Suggestions?

I fixed up the path and it seemed to come good

PATH=%PATH%;C:\Users\Phoenix\AppData\Local\Programs\Git\cmd;C:\Users\Phoenix\AppData\Local\Programs\Git\mwing64\Bin;C:\Users\Phoenix\AppData\Local\Programs\Git\usr\Bin

I would say that the installer did some of those but the β€˜npm install’ command seems to work now.

Now to work out how to connect to the device.

1 Like