最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

Nodejs:无法加载gRPC二进制模块,因为它没有为当前系统安装

IT培训 admin 2浏览 0评论

Nodejs:无法加载gRPC二进制模块,因为它没有为当前系统安装

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

经过尝试,这对我有用

Nodejs:无法加载gRPC二进制模块,因为它没有为当前系统安装

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

经过尝试,这对我有用

发布评论

评论列表 (0)

  1. 暂无评论