电子重建grpc构建失败

时间:2017-04-13 00:17:35

标签: node.js electron node-gyp grpc

当我尝试运行电子重建以使grpc为Electron工作时,我得到以下错误。当我的同事做同样的事情时,没有错误。我们无法确定我们的环境有何不同。 Windows 10 64,node64,VS2015包3,“电子”:“1.6.6”,“电子重建”:“^ 1.5.7”

有什么想法吗?错误并没有告诉我太多。

C:\Dev\Projects\Electron\PAT\client>npm run rebuild

> @ rebuild C:\Dev\Projects\Electron\PAT\client
> electron-rebuild -m ./app

× Rebuild Failed
An unhandled error occurred inside electron-rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  WINDOWS_BUILD_WARNING
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code -1073741515. [C:\Dev\Projects\Electron\PAT\client\app\node_modules\grpc\build\WINDOWS_BUILD_WARNING.vcxproj]

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:\Dev\Projects\Electron\PAT\client\node_modules\node-gyp\lib\build.js:285:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:194:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Dev\\Projects\\Electron\\PAT\\client\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=1.6.6" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source" "--module_name=grpc_node" "--module_path=C:\\Dev\\Projects\\Electron\\PAT\\client\\app\\node_modules\\grpc\\src\\node\\extension_binary" "--host=https://storage.googleapis.com/" "--remote_path=grpc-precompiled-binaries/node/{name}/v1.2.3" "--package_name=electron-v1.6-win32-x64.tar.gz"
gyp ERR! cwd C:\Dev\Projects\Electron\PAT\client\app\node_modules\grpc
gyp ERR! node -v v7.8.0
gyp ERR! node-gyp -v v3.6.0
gyp ERR! not ok

Failed with exit code: 1

Error: Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  WINDOWS_BUILD_WARNING
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code -1073741515. [C:\Dev\Projects\Electron\PAT\client\app\node_modules\grpc\build\WINDOWS_BUILD_WARNING.vcxproj]

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:\Dev\Projects\Electron\PAT\client\node_modules\node-gyp\lib\build.js:285:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:194:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Dev\\Projects\\Electron\\PAT\\client\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=1.6.6" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source" "--module_name=grpc_node" "--module_path=C:\\Dev\\Projects\\Electron\\PAT\\client\\app\\node_modules\\grpc\\src\\node\\extension_binary" "--host=https://storage.googleapis.com/" "--remote_path=grpc-precompiled-binaries/node/{name}/v1.2.3" "--package_name=electron-v1.6-win32-x64.tar.gz"
gyp ERR! cwd C:\Dev\Projects\Electron\PAT\client\app\node_modules\grpc
gyp ERR! node -v v7.8.0
gyp ERR! node-gyp -v v3.6.0
gyp ERR! not ok

Failed with exit code: 1
    at SafeSubscriber._error (C:\Dev\Projects\Electron\PAT\client\node_modules\spawn-rx\lib\src\index.js:262:84)
    at SafeSubscriber.__tryOrUnsub (C:\Dev\Projects\Electron\PAT\client\node_modules\rxjs\Subscriber.js:236:16)
    at SafeSubscriber.error (C:\Dev\Projects\Electron\PAT\client\node_modules\rxjs\Subscriber.js:197:26)
    at Subscriber._error (C:\Dev\Projects\Electron\PAT\client\node_modules\rxjs\Subscriber.js:128:26)
    at Subscriber.error (C:\Dev\Projects\Electron\PAT\client\node_modules\rxjs\Subscriber.js:102:18)
    at MapSubscriber.Subscriber._error (C:\Dev\Projects\Electron\PAT\client\node_modules\rxjs\Subscriber.js:128:26)
    at MapSubscriber.Subscriber.error (C:\Dev\Projects\Electron\PAT\client\node_modules\rxjs\Subscriber.js:102:18)
    at SafeSubscriber._next (C:\Dev\Projects\Electron\PAT\client\node_modules\spawn-rx\lib\src\index.js:236:65)
    at SafeSubscriber.__tryOrUnsub (C:\Dev\Projects\Electron\PAT\client\node_modules\rxjs\Subscriber.js:236:16)
    at SafeSubscriber.next (C:\Dev\Projects\Electron\PAT\client\node_modules\rxjs\Subscriber.js:185:22)
    at Subscriber._next (C:\Dev\Projects\Electron\PAT\client\node_modules\rxjs\Subscriber.js:125:26)
    at Subscriber.next (C:\Dev\Projects\Electron\PAT\client\node_modules\rxjs\Subscriber.js:89:18)
    at ReduceSubscriber._complete (C:\Dev\Projects\Electron\PAT\client\node_modules\rxjs\operator\reduce.js:119:30)
    at ReduceSubscriber.Subscriber.complete (C:\Dev\Projects\Electron\PAT\client\node_modules\rxjs\Subscriber.js:114:18)
    at MergeAllSubscriber.notifyComplete (C:\Dev\Projects\Electron\PAT\client\node_modules\rxjs\operator\mergeAll.js:105:30)
    at InnerSubscriber._complete (C:\Dev\Projects\Electron\PAT\client\node_modules\rxjs\InnerSubscriber.js:30:21)

2 个答案:

答案 0 :(得分:0)

您所看到的错误与this GitHub issue中报告的错误相同。基本上,gRPC的binding.gyp文件中的操作在Windows 10控制台中无法正常工作。

答案 1 :(得分:0)

很多年后,遇到了类似的错误。原来是我使用的cli的问题。 Gitbash和命令提示符均失败,但以管理员身份运行Powershell起作用。对于其他遭受苦难的人,希望您能找到并成功建立。