OS - windows 10
node.js version - 8.9.4
npm version - 5.6.0
1) open command prompt in selected folder
2) Run "npm install -g firebase-tools" command.
Should be installed packages related to firebase.
Getting errors while running above mentioned command..
C:\Users\Chetan\Desktop\aaa>npm install -g firebase-tools
npm WARN deprecated [email protected]: Use uuid module instead
C:\Users\Chetan\AppData\Roaming\npm\firebase -> C:\Users\Chetan\AppData\Roaming\npmnode_modules\firebase-tools\bin\firebase
[email protected] install C:\Users\Chetan\AppData\Roaming\npmnode_modules\firebase-toolsnode_modules\grpc
node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp ERR! Tried to download(undefined): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.4.1/node-v57-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v57 ABI) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files\nodejsnode_modules\npmnode_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at PythonFinder.
gyp ERR! stack at C:\Program Files\nodejsnode_modules\npmnode_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=C:\Users\Chetan\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\grpc\src\node\extension_binary\grpc_node.node" "--module_name=grpc_node" "--module_path=C:\Users\Chetan\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\grpc\src\node\extension_binary"
gyp ERR! cwd C:\Users\Chetan\AppData\Roaming\npmnode_modules\firebase-toolsnode_modules\grpc
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejsnode_modules\npmnode_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=C:\Users\Chetan\AppData\Roaming\npmnode_modules\firebase-toolsnode_modules\grpc\src\node\extension_binary\grpc_node.node --module_name=grpc_node --module_path=C:\Users\Chetan\AppData\Roaming\npmnode_modules\firebase-toolsnode_modules\grpc\src\node\extension_binary' (1)
node-pre-gyp ERR! stack at ChildProcess.
node-pre-gyp ERR! stack at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Windows_NT 10.0.16299
node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Chetan\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\grpc\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd C:\Users\Chetan\AppData\Roaming\npmnode_modules\firebase-toolsnode_modules\grpc
node-pre-gyp ERR! node -v v8.9.4
node-pre-gyp ERR! node-pre-gyp -v v0.6.36
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejsnode_modules\npmnode_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=C:\Users\Chetan\AppData\Roaming\npmnode_modules\firebase-toolsnode_modules\grpc\src\node\extension_binary\grpc_node.node --module_name=grpc_node --module_path=C:\Users\Chetan\AppData\Roaming\npmnode_modules\firebase-toolsnode_modules\grpc\src\node\extension_binary' (1)
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): EPERM: operation not permitted, scandir 'C:\Users\Chetan\AppData\Roaming\npmnode_modules\firebase-toolsnode_modules\grpcnode_modules\node-pre-gypnode_modules\rimrafnode_modules\globnode_modules\minimatchnode_modules\brace-expansionnode_modules'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): EPERM: operation not permitted, scandir 'C:\Users\Chetan\AppData\Roaming\npmnode_modules\firebase-toolsnode_modules\grpcnode_modules\node-pre-gypnode_modules\tar-packnode_modules\fstream-ignorenode_modules\minimatchnode_modules\brace-expansionnode_modules'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\firebase-toolsnode_modules\grpc):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: node-pre-gyp install --fallback-to-build --library=static_library
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
Same error, different causes

hey i am also getting the same error
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\Phani\AppData\Roaming\npmnode_modules\npmnode_modules\node-gyp\lib\build.js:258: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 10.0.16299
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Phani\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=C:\Users\Phani\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\grpc\src\node\extension_binary\grpc_node.node" "--module_name=grpc_node" "--module_path=C:\Users\Phani\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\grpc\src\node\extension_binary"
gyp ERR! cwd C:\Users\Phani\AppData\Roaming\npmnode_modules\firebase-toolsnode_modules\grpc
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Phani\AppData\Roaming\npmnode_modules\npmnode_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --library=static_library --module=C:\Users\Phani\AppData\Roaming\npmnode_modules\firebase-toolsnode_modules\grpc\src\node\extension_binary\grpc_node.node --module_name=grpc_node --module_path=C:\Users\Phani\AppData\Roaming\npmnode_modules\firebase-toolsnode_modules\grpc\src\node\extension_binary' (1)
node-pre-gyp ERR! stack at ChildProcess.
node-pre-gyp ERR! stack at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Windows_NT 10.0.16299
node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Phani\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\grpc\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd C:\Users\Phani\AppData\Roaming\npmnode_modules\firebase-toolsnode_modules\grpc
node-pre-gyp ERR! node -v v8.9.4
node-pre-gyp ERR! node-pre-gyp -v v0.6.36
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Phani\AppData\Roaming\npmnode_modules\npmnode_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --library=static_library --module=C:\Users\Phani\AppData\Roaming\npmnode_modules\firebase-toolsnode_modules\grpc\src\node\extension_binary\grpc_node.node --module_name=grpc_node --module_path=C:\Users\Phani\AppData\Roaming\npmnode_modules\firebase-toolsnode_modules\grpc\src\node\extension_binary' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\firebase-toolsnode_modules\grpc):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: node-pre-gyp install --fallback-to-build --library=static_library
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
Here we are getting this error not only in Windows 10 but also getting Mac OS too
Uninstall this one and install previous version (v3.17.2) See my answer on Stackoverflow
UPDATE
Today published version (v3.17.4) has the same problem, still getting errors on install therefore I'm still stuck with v3.17.2.
Have you tried updating to the latest version of NPM and the latest patch version of the version of Node you're using? That's the most common solution for these types of problems in my experience.
In my case:
UPDATE
with Node 9.4.0 & NPM 5.6.0 I'm getting same error in question above, yet since it says "Skipping optional dependency" I'll try using it, hoping won't crash in the future.
Please report your issues in grpc/grpc-node#121 as I'm trying to consolidate all GRPC installation errors to that bug.
UPDATE 2
windows-build-tools package got an update yesterday so I installed it with hope it solves the problems installing latest version of firebase-tools. It did not, same errors occur.
I had a similar problem and error on my Windows 10 machine. My solution was to download Python 2.7.14 msi installer from python.org. During install customization, be sure to enable the "Add python.exe to Path" option.
Then run npm install -g firebase-tools again. This worked for me.
Node v8.9.4
NPM v5.6.0
firebase-tools v3.17.4
@exawatt I did, Python is working on my machine, it had nothing to do with build error for native packages it tries to build & fails.
@bogacg, @chetan4651 Any solution plz ?
The problem here is that there are no pre-built binaries available for Node 9 and gRPC 1.4.1 and building gRPC fails on Windows. I've invested a lot of time trying to get gRPC to build, but still no luck.
There are gRPC binaries available for the latest version though, 1.9.1.
@mbleigh Can the version of the gRPC dependency be bumped to 1.9.1? That would solve this issue for all of us Windows users, because we wouldn't have to build anymore.
EDIT:
Well actually not "this" issue, because the op simply doesn't have Python configured correctly, so he doesn't even get to the point where the build fails.
Until the version is bumped, I could get gRPC to compile by temporarily removing %USERPROFILE%\.node-gyp\<version>\include\node\openssl. Otherwise MSBuild.exe fails.
Please update to a version of grpc that has precompiled binaries for windows, compiling _anything_ on windows is a pain, the only sane solution is to have it precompiled.
Guys, i dont belive... work for me. take a look:
Kaspersky Anti-virus has an active invasive check into HTTPS connections that causes this kind of problem with npm. Tested with antivirus on and off and I can confirm that it is causing the problem.
After completely disabling Encrypted connections scanning all worked as intended.
I had this same problem sin 3.17.3 and struggled with it. FINALLY resolved it by DISABLING my Kaspersky antivirus!
Cleane installation Chace with:
npm cache clean --force
and install again firebase tools
npm install -g firebase-tools
Cleane installation Chace with:
npm cache clean --force
and install again firebase tools
npm install -g firebase-tools
Thank you so much! That fixed the error.
I had the same problem with Windows Defender. After disabling Windows Defender, it all worked as expected.
I should note that I'm working in a Linux VM in virtualbox on top of Windows 10, and Windows Defender still caused this issue.
Hi! That solved me the problem:
sudo npm i -g firebase-tools
try running as administrator, it worked for me........
here is my case:
$ npm --version
6.14.6
$ node --version
v12.18.3
using this command :$ npm install -g firebase-tools =>FAILED.
using this command :$ npm i -g firebase-tools => SUCCESS.
not sure what different between 'install' and 'i'.
Thanks this worked
Most helpful comment
Guys, i dont belive... work for me. take a look:
Kaspersky Anti-virus has an active invasive check into HTTPS connections that causes this kind of problem with npm. Tested with antivirus on and off and I can confirm that it is causing the problem.
After completely disabling Encrypted connections scanning all worked as intended.
https://github.com/grpc/grpc-node/issues/140