node.js - Nodejs : Failed to load gRPC binary module because it was not installed for the current system

标签 node.js typescript

我正在使用带有 Typescript 的电子框架开发一个桌面应用程序。当我尝试使用 npm start 部署应用程序时,出现以下错误:

    Uncaught Error: Failed to load gRPC binary module because it was not installed for the current system
Expected directory: electron-v4.0-darwin-x64-unknown
Found: [node-v64-darwin-x64-unknown]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: Cannot find module '/Users/ahmet/Documents/JumbleUp-Desktop/node_modules/grpc/src/node/extension_binary/electron-v4.0-darwin-x64-unknown/grpc_node.node'
    at Object.<anonymous> (node_modules/grpc/src/grpc_extension.js:53)
    at Object.<anonymous> (node_modules/grpc/src/grpc_extension.js:63)
    at Module._compile (internal/modules/cjs/loader.js:693)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:704)
    at Module.load (internal/modules/cjs/loader.js:602)
    at tryModuleLoad (internal/modules/cjs/loader.js:541)
    at Function.Module._load (internal/modules/cjs/loader.js:533)
    at Module.require (internal/modules/cjs/loader.js:640)
    at require (internal/modules/cjs/helpers.js:20)
    at Object.<anonymous> (node_modules/grpc/src/client_interceptors.js:144)

尝试了互联网上编写的许多解决方案,但似乎都不起作用,提前致谢。

最佳答案

> npm install electron-rebuild
> ./node_modules/.bin/electron-rebuild

经过可能的尝试,这对我有用

关于node.js - Nodejs : Failed to load gRPC binary module because it was not installed for the current system,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54621427/

相关文章:

angular - 通过映射将类型(接口(interface))转换为可观察的

javascript - JOI - 验证复杂对象

node.js - 一个 JavaScript 框架,包括服务器端和客户端,用于描述表单并验证它们?

带有 keyof 的 Typescript 函数不接受对象键值作为有效的 keyof

typescript :返回基于对象中 ReturnTypes 的联合

node.js - 在 VS 代码中调试由 Electron 生成的子进程

javascript - 在 node.js 服务器上生成 URL

javascript - 将 Dynamo DB 流数据解码为 Json 格式

javascript - 如何为 Electron 中的启动画面添加延迟

typescript 设置函数成员并使用它