firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

Unable to complete "npm install -g firebase-tools" command in windows 10 environment

Open chetan4651 opened this issue 8 years ago • 26 comments

Version info

OS - windows 10 node.js version - 8.9.4 npm version - 5.6.0

Steps to reproduce

  1. open command prompt in selected folder
  2. Run "npm install -g firebase-tools" command.

Expected behavior

Should be installed packages related to firebase.

Actual behavior

Getting errors while running above mentioned command..

LOG

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\npm\node_modules\firebase-tools\bin\firebase

[email protected] install C:\Users\Chetan\AppData\Roaming\npm\node_modules\firebase-tools\node_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\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19) gyp ERR! stack at PythonFinder. (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16) gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_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\npm\node_modules\firebase-tools\node_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\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' (1) node-pre-gyp ERR! stack at ChildProcess. (C:\Users\Chetan\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\grpc\node_modules\node-pre-gyp\lib\util\compile.js:83:29) 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\npm\node_modules\firebase-tools\node_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\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' (1) npm WARN rollback Rolling back [email protected] failed (this is probably harmless): EPERM: operation not permitted, scandir 'C:\Users\Chetan\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\grpc\node_modules\node-pre-gyp\node_modules\rimraf\node_modules\glob\node_modules\minimatch\node_modules\brace-expansion\node_modules' npm WARN rollback Rolling back [email protected] failed (this is probably harmless): EPERM: operation not permitted, scandir 'C:\Users\Chetan\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\grpc\node_modules\node-pre-gyp\node_modules\tar-pack\node_modules\fstream-ignore\node_modules\minimatch\node_modules\brace-expansion\node_modules' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\firebase-tools\node_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

chetan4651 avatar Jan 22 '18 16:01 chetan4651

Same error, different causes

image

danielsada avatar Jan 22 '18 20:01 danielsada

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\npm\node_modules\npm\node_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\npm\node_modules\firebase-tools\node_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\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' (1) node-pre-gyp ERR! stack at ChildProcess. (C:\Users\Phani\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\grpc\node_modules\node-pre-gyp\lib\util\compile.js:83:29) 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\npm\node_modules\firebase-tools\node_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\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' (1) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\firebase-tools\node_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

techiepop avatar Jan 23 '18 04:01 techiepop

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.

bogacg avatar Jan 23 '18 07:01 bogacg

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.

mbleigh avatar Jan 29 '18 05:01 mbleigh

In my case:

  • Node 9.3.0
  • NPM: 5.5.1

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.

bogacg avatar Jan 29 '18 07:01 bogacg

Please report your issues in grpc/grpc-node#121 as I'm trying to consolidate all GRPC installation errors to that bug.

mbleigh avatar Jan 29 '18 21:01 mbleigh

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.

bogacg avatar Feb 01 '18 10:02 bogacg

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 avatar Feb 03 '18 03:02 exawatt

@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 avatar Feb 03 '18 10:02 bogacg

@bogacg, @chetan4651 Any solution plz ?

danilolopesabreu avatar Feb 17 '18 03:02 danilolopesabreu

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.

xelra avatar Feb 22 '18 20:02 xelra

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.

xelra avatar Feb 23 '18 13:02 xelra

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.

StigOlavsen avatar Mar 06 '18 14:03 StigOlavsen

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

danilolopesabreu avatar Mar 21 '18 04:03 danilolopesabreu

I had this same problem sin 3.17.3 and struggled with it. FINALLY resolved it by DISABLING my Kaspersky antivirus!

chachew avatar Apr 26 '18 00:04 chachew

Cleane installation Chace with:

npm cache clean --force

and install again firebase tools

npm install -g firebase-tools

jagungodak avatar Oct 09 '18 00:10 jagungodak

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.

james-lubin avatar Nov 03 '18 00:11 james-lubin

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.

dwatrous avatar Nov 16 '18 00:11 dwatrous

Hi! That solved me the problem: sudo npm i -g firebase-tools

GuySarkinsky avatar Sep 25 '19 17:09 GuySarkinsky

try running as administrator, it worked for me........

rub9542 avatar Jul 09 '20 14:07 rub9542