Node.js gRPC在电子工业中的应用
我试图在electron应用程序中要求grpc,但我得到以下错误:Node.js gRPC在电子工业中的应用,node.js,electron,grpc,electron-builder,Node.js,Electron,Grpc,Electron Builder,我试图在electron应用程序中要求grpc,但我得到以下错误: Error: dlopen(/srv/node_modules/grpc/src/node/extension_binary/grpc_node.node, 1): Symbol not found: _GENERAL_NAME_free Referenced from: /srv/node_modules/grpc/src/node/extension_binary/grpc_node.node Expected in
Error: dlopen(/srv/node_modules/grpc/src/node/extension_binary/grpc_node.node, 1): Symbol not found: _GENERAL_NAME_free
Referenced from: /srv/node_modules/grpc/src/node/extension_binary/grpc_node.node
Expected in: flat namespace
我使用的是OSX Sierra 10.12.1、node 6.8.1、electron 1.4.4和grpc 1.0.1-pre1
我升级了xcode命令行工具,并用brew安装了openssl——force
我使用以下方法构建二进制文件:
LDFLAGS=-L/usr/local/opt/openssl/lib CPPFLAGS=-I/usr/local/opt/openssl/include ./node_modules/.bin/electron-rebuild
并手动使用:
LDFLAGS=-L/usr/local/opt/openssl/lib CPPFLAGS=-I/usr/local/opt/openssl/include HOME=~/.electron-gyp node-pre-gyp rebuild --target=1.4.4 --arch=x64 --dist-url=https://atom.io/download/atom-shell
但当我运行应用程序时,仍然会出现错误。像这样重建grpc模块
npm install --save-dev electron-rebuild
(On Mac & Linux)
./node_modules/.bin/electron-rebuild
(On Windows)
.\node_modules\.bin\electron-rebuild.cmd
这将重建GRPC,您可以开始了。您解决过这个问题吗?