我正在使用带有 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/