grpc / grpc-node

gRPC for Node.js
https://grpc.io
Apache License 2.0
4.44k stars 640 forks source link

Error installing on Windows 10 #728

Closed ad34 closed 3 years ago

ad34 commented 5 years ago

Problem description

Error installing on Windows 10 with npm or yarn I know this issue has been mentionned many time here and marked as closed, but it s not fixed on our windows 10 build machine so opening a new issue .

Reproduction steps

start a new node.js project npm init npm install grpc --save

node-pre-gyp WARN Using needle for node-pre-gyp https download node-pre-gyp WARN Tried to download(500): https://node-precompiled-binaries.grpc.io/grpc/v1.18.0/node-v64-win32-x64-unknown.tar.gz node-pre-gyp WARN Pre-built binaries not found for grpc@1.18.0 and node@10.15.1 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)

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\myuser\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23) gyp ERR! stack at ChildProcess.emit (events.js:189:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\myuser\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\nod e-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=C:\Users\myuser\Desktop\firebasetest\node_modules\grpc\src\node\ \extension_binary\node-v64-win32-x64-unknown\grpc_node.node" "--module_name=grpc_node" "--module_path=C:\Users\myuser\Desktop\firebasetest\nod e_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown" "--napi_version=3" "--node_abi_napi=napi" "--napi_build_version=0" "--node_n api_label=node-v64" gyp ERR! cwd C:\Users\myuser\Desktop\firebasetest\node_modules\grpc gyp ERR! node -v v10.15.1 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok

Environment

Additional context

I am behind a corporate proxy , but everything is configured to run smoothly with npm as it s centric in our pipeline

npm config get

; cli configs metrics-registry = "https://registry.npmjs.org/" scope = "" user-agent = "npm/6.7.0 node/v10.15.1 win32 x64"

; userconfig C:\Users\myuser.npmrc color = true http-*proxy = "http://proxy.mycompany.org:3128/" http-proxy = "http://proxy.mycompany.org:3128/" https-proxy = "http://proxy.mycompany.org:3128/" msvs_version = "2015" proxy = "http://proxy.mycompany.org:3128/" registry = "https://registry.npmjs.org/" strict-ssl = false

; builtin config undefined prefix = "C:\Users\myuser\AppData\Roaming\npm"

; node bin location = C:\Program Files\nodejs\node.exe ; cwd = C:\Users\myuser\Desktop\firebasetest ; HOME = C:\Users\myuser ; "npm config ls -l" to show all defaults.

I tried to install node-pre-gyp as global , npm cache clean --force , but the issue is still present. pre compiled binaries cannot be found, and compilation failed

ad34 commented 5 years ago

looks like the issue is caused by npm (or node gyp ? ) not properly handling the proxy because of the "/" at the end of the npm http-proxy config setting. solved for me.

ad34 commented 5 years ago

actually the problem is still present after a few successful install. I have no idea why this issue is so unpredicable , but I m sure there is a problem somewhere, on this module, node gyp/ pre gyp or npm itself . it s probably related to a module not handling properly the proxy.

murgatroid99 commented 5 years ago

I think npm should give you a log file with the verbose log output, at least when it fails. That might have some information from node-pre-gyp about the proxy setting.

orgads commented 5 years ago

I'm not sure it's the same problem, but I also ran into build failure when npm failed to download the binary package because it did not have the corporate firewall CA. Log here: https://gist.github.com/orgads/b5d17bfbb299e660e6b6f02197a939ab

I was able to download the binary package by setting NODE_EXTRA_CA_CERTS, but do you know why building from source fails?

ad34 commented 5 years ago

@orgads looks like the same issue, we get the same compilation errors. I m curious of how you sloved your issue with NODE_EXTRA_CA_CERTS. and curious as well of the compilation issue, openssl should compile fine on windows.

nicolasnoble commented 5 years ago

Compiling a node extension targetting Windows that uses OpenSSL is very difficult. See https://github.com/nodejs/node-gyp/wiki/Linking-to-OpenSSL

ad34 commented 5 years ago

thank @nicolasnoble . so precompiled binaries seems to be the only viable solution. the issue may be related to this : https://github.com/mapbox/node-pre-gyp/issues/400

nicolasnoble commented 5 years ago

Maybe. I am actually a maintainer of node-pre-gyp. I can make this revert happen.

McMerph commented 5 years ago

npm i -g node-gyp work for me

nabajitroy commented 4 years ago

This what I did to solve the problem (off-course temprory): npm install -> It will install grpc along with other module. But build will fail. go to package.json file in grpc module and change the binary section with a build which exists in repository like: "binary": { "module_name": "grpc_node", "module_path": "grpc-precompiled-binaries/node/grpc-tools/v0.15.0", "host": "https://node-precompiled-binaries.grpc.io/", "remote_path": "grpc-precompiled-binaries/node/grpc-tools/v0.15.0", "package_name": "windows-x64.tar.gz" }, run npm rebuild. Hope his will help someone. Thanks

sdfrao commented 4 years ago

node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.10.1/node-v72-win32-x64-unknown.tar.gz node-pre-gyp ERR! Pre-built binaries not found for grpc@1.10.1 and node@12.14.1 (node-v72 ABI, unknown) (falling back to source compile with node-gyp) node-pre-gyp ERR! Pre-built binaries not installable for grpc@1.10.1 and node@12.14.1 (node-v72 ABI, unknown) (falling back to source compile with node-gyp) node-pre-gyp ERR! Hit error Connection closed while downloading tarball file gyp ERR! find VS gyp ERR! find VS msvs_version not set from command line or npm config gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer gyp ERR! find VS looking for Visual Studio 2015 gyp ERR! find VS - found in "C:\Program Files (x86)\Microsoft Visual Studio 14.0" gyp ERR! find VS - could not find MSBuild in registry for this version gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8 gyp ERR! find VS gyp ERR! find VS ** gyp ERR! find VS You need to install the latest version of Visual Studio gyp ERR! find VS including the "Desktop development with C++" workload. gyp ERR! find VS For more information consult the documentation at: gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows gyp ERR! find VS ** gyp ERR! find VS gyp ERR! configure error gyp ERR! stack Error: Could not find any Visual Studio installation to use gyp ERR! stack at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47) gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16 gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14) gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14 gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:384:20 gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7 gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16 gyp ERR! stack at ChildProcess.exithandler (child_process.js:302:5) gyp ERR! stack at ChildProcess.emit (events.js:223:5) gyp ERR! stack at maybeClose (internal/child_process.js:1021:16) gyp ERR! System Windows_NT 6.1.7601 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\sdf apk toolkit\ionic\whos-present-master\node_modules\grpc\src\node\extension_binary\node-v72-win32-x64-unknown\grpc_node.node" "--module_name=grpc_node" "--module_path=C:\Users\sdf apk toolkit\ionic\whos-present-master\node_modules\grpc\src\node\extension_binary\node-v72-win32-x64-unknown" "--python=C:/Program Files/Git/path/to/executable/python" gyp ERR! cwd C:\Users\sdf apk toolkit\ionic\whos-present-master\node_modules\grpc gyp ERR! node -v v12.14.1 gyp ERR! node-gyp -v v5.0.5 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\sdf apk toolkit\ionic\whos-present-master\node_modules\grpc\src\node\extension_binary\node-v72-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=C:\Users\sdf apk toolkit\ionic\whos-present-master\node_modules\grpc\src\node\extension_binary\node-v72-win32-x64-unknown --python=C:/Program Files/Git/path/to/executable/python' (1) node-pre-gyp ERR! stack at ChildProcess. (C:\Users\sdf apk toolkit\ionic\whos-present-master\node_modules\grpc\node_modules\node-pre-gyp\lib\util\compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:223:5) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) node-pre-gyp ERR! System Windows_NT 6.1.7601 node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\sdf apk toolkit\ionic\whos-present-master\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\sdf apk toolkit\ionic\whos-present-master\node_modules\grpc node-pre-gyp ERR! node -v v12.14.1 node-pre-gyp ERR! node-pre-gyp -v v0.7.0 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\sdf apk toolkit\ionic\whos-present-master\node_modules\grpc\src\node\extension_binary\node-v72-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=C:\Users\sdf apk toolkit\ionic\whos-present-master\node_modules\grpc\src\node\extension_binary\node-v72-win32-x64-unknown --python=C:/Program Files/Git/path/to/executable/python' (1) npm WARN @ionic-native/app-version@4.20.0 requires a peer of @ionic-native/core@^4.11.0 but none is installed. You must install peer dependencies yourself. npm WARN @ionic-native/app-version@4.20.0 requires a peer of rxjs@^5.5.11 but none is installed. You must install peer dependencies yourself. npm WARN @ionic-native/facebook@4.20.0 requires a peer of @ionic-native/core@^4.11.0 but none is installed. You must install peer dependencies yourself. npm WARN @ionic-native/facebook@4.20.0 requires a peer of rxjs@^5.5.11 but none is installed. You must install peer dependencies yourself. npm WARN @ionic-native/firebase@5.21.5 requires a peer of rxjs@^5.5.0 || ^6.5.0 but none is installed. You must install peer dependencies yourself. npm WARN @ionic-native/firebase@5.21.5 requires a peer of @ionic-native/core@^5.1.0 but none is installed. You must install peer dependencies yourself. npm WARN @ionic-native/google-analytics@4.20.0 requires a peer of @ionic-native/core@^4.11.0 but none is installed. You must install peer dependencies yourself. npm WARN @ionic-native/google-analytics@4.20.0 requires a peer of rxjs@^5.5.11 but none is installed. You must install peer dependencies yourself. npm WARN @swimlane/ngx-charts@6.1.0 requires a peer of @angular/common@^4.2.x but none is installed. You must install peer dependencies yourself. npm WARN @swimlane/ngx-charts@6.1.0 requires a peer of @angular/core@^4.2.x but none is installed. You must install peer dependencies yourself. npm WARN angularfire2@4.0.0-rc0 requires a peer of firebase@^3.6.6 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! grpc@1.10.1 install: node-pre-gyp install --fallback-to-build --library=static_library npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the grpc@1.10.1 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\SADAF_YOUNAS.MHF\AppData\Roaming\npm-cache_logs\2020-02-18T07_29_05_791Z-debug.log having this error tried everything , please help me to resolve th eissue

murgatroid99 commented 4 years ago

grpc 1.10 is old enough that it probably doesn't work with Node 12. The latest version of grpc is 1.24.2. I suggest using that instead.

alanpurple commented 3 years ago

@murgatroid99 also error with 1.24.2

murgatroid99 commented 3 years ago

The details of the error matter. There have been at least 3 errors shared in this issue and they're all substantially different and were caused by different problems. What error, specifically, did you get?

murgatroid99 commented 3 years ago

The grpc package is now deprecated, so we will not be making further fixes to address these problems.