简体   繁体   English

Node.js:无法加载gRPC二进制模块,因为当前系统未安装该模块

[英]Nodejs: Failed to load gRPC binary module because it was not installed for the current system

I'm developing a desktop app using electron framework with Typescript. 我正在使用带有Typescript的电子框架开发一个桌面应用程序。 When I try to deploy app with npm start I get the following error: 当我尝试使用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)

Tried many solutions written on the internet but none of them seems to work, thanks in advance. 尝试了许多写在Internet上的解决方案,但似乎都没有用,谢谢。

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

After may tries this worked for me 在可能尝试之后对我有用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM