Problem with grpc and node-gyp while downloading firebase
I got a problem when trying to execute the following instruction in my Angular project :
npm install firebase --save
Here is the result I obtain :
> [email protected] install C:\Users\jhardouineau\Documents\Formation\OpenClassrooms\Angular\bookshelves\node_modules\grpc
> node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error connect ETIMEDOUT 104.28.22.74:443
gyp ERR! find Python
gyp ERR! find Python checking Python explicitly set from command line or npm configuration
gyp ERR! find Python - "--python=" or "npm config get python" is "D:\TOOLS\Perso"
gyp ERR! find Python - "D:\TOOLS\Perso" is not in PATH or produced an error
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - executable path is "C:\Users\jhardouineau\AppData\Local\Programs\Python\Python37-32\python.exe"
gyp ERR! find Python - version is "3.7.4"
gyp ERR! find Python - version is 3.7.4 - should be >=2.6.0 <3.0.0
gyp ERR! find Python - THIS VERSION OF PYTHON IS NOT SUPPORTED
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python checking if Python 2 is installed in the default location
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python 2.7.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
gyp ERR! find Python (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python npm config set python "C:\Path\To\python.exe"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python 2 installation to use
gyp ERR! stack at PythonFinder.fail (C:\Users\jhardouineau\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:625:47)
gyp ERR! stack at PythonFinder.runChecks (C:\Users\jhardouineau\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:452:21)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Users\jhardouineau\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:542:16)
gyp ERR! stack at PythonFinder.execFileCallback (C:\Users\jhardouineau\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:588:16)
gyp ERR! stack at exithandler (child_process.js:301:5)
gyp ERR! stack at ChildProcess.errorhandler (child_process.js:313:5)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
gyp ERR! stack at onErrorNT (internal/child_process.js:415:16)
gyp ERR! stack at process._tickCallback (internal/process/next_tick.js:63:19)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\jhardouineau\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=C:\\Users\\jhardouineau\\Documents\\Formation\\OpenClassrooms\\Angular\\bookshelves\\node_modules\\grpc\\src\\node\\extension_binary\\node-v64-win32-x64-unknown\\grpc_node.node" "--module_name=grpc_node" "--module_path=C:\\Users\\jhardouineau\\Documents\\Formation\\OpenClassrooms\\Angular\\bookshelves\\node_modules\\grpc\\src\\node\\extension_binary\\node-v64-win32-x64-unknown" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64" "--python=D:\\TOOLS\\Perso"
gyp ERR! cwd C:\Users\jhardouineau\Documents\Formation\OpenClassrooms\Angular\bookshelves\node_modules\grpc
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v5.0.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\jhardouineau\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=C:\Users\jhardouineau\Documents\Formation\OpenClassrooms\Angular\bookshelves\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=C:\Users\jhardouineau\Documents\Formation\OpenClassrooms\Angular\bookshelves\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64 --python=D:\TOOLS\Perso' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\jhardouineau\Documents\Formation\OpenClassrooms\Angular\bookshelves\node_modules\grpc\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:198:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:982:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Windows_NT 10.0.17134
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\jhardouineau\\Documents\\Formation\\OpenClassrooms\\Angular\\bookshelves\\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\jhardouineau\Documents\Formation\OpenClassrooms\Angular\bookshelves\node_modules\grpc
node-pre-gyp ERR! node -v v10.16.0
node-pre-gyp ERR! node-pre-gyp -v v0.13.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\jhardouineau\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=C:\Users\jhardouineau\Documents\Formation\OpenClassrooms\Angular\bookshelves\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=C:\Users\jhardouineau\Documents\Formation\OpenClassrooms\Angular\bookshelves\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown --napi_version=4 --node_abi_napi=napi
--napi_build_version=0 --node_napi_label=node-v64 --python=D:\TOOLS\Perso' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\webpack-dev-server\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\watchpack\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\karma\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\@angular\compiler-cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\jhardouineau\AppData\Roaming\npm-cache\_logs\2019-07-23T08_45_35_409Z-debug.log
I found a lot of explanations to resolve this, but nothing seems to work for me. Maybe I'm missing something here, let me know if you can help !
Thanks
You need to install legacy Python.
gyp ERR! find Python - version is "3.7.4"
gyp ERR! find Python - version is 3.7.4 - should be >=2.6.0 <3.0.0
gyp ERR! find Python - THIS VERSION OF PYTHON IS NOT SUPPORTED
Thanks, in the link you gave, the instructions until "How to Use" are working and the problem with Python seems to be over. However, the steps in "How to use" don't work. I think it might be a versioning problem between the version of node and the version of node-gyp...
Perhaps close this issue and then open a new one if you can not figure the next issue out.
I installed npm install node-pre-gyp -g on the root user.then tried installing npm i firebase again.this worked for me