我正在尝试运行一个脚本来初始化 Firebase 连接,然后对新集合进行测试写入/读取。在 Node.js 8.10.0 上运行该脚本时,我收到此错误:
node: symbol lookup error: /home/owner/PhpstormProjects/folder_name/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc/grpc_node.node: undefined symbol: SSL_library_init
以下是代码:
const firebase_admin = require("firebase-admin");
const firebase_service_account = require("../project_name-firebase-admin-xyz");
firebase_admin.initializeApp({
credential: firebase_admin.credential.cert(firebase_service_account)
});
const firestore = firebase_admin.firestore();
console.log("line 11");
let docRef = firestore.collection("test").doc("alovelace");
let setAda = docRef.set({ first : "Ada" });
console.log("line 17");
输出:
owner@G700:~/PhpstormProjects/project_folder$ node ./gitignore/scratch_area/firebase_1a_minimal.js
line 11
line 17
node: symbol lookup error: /home/owner/PhpstormProjects/project_folder/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc/grpc_node.node: undefined symbol: SSL_library_init
我尝试删除let setAda = docRef.set({ first : "Ada" });
。这可以避免出现错误消息。
这似乎是在设置新记录时出现的问题,无论是在 Firestore 端,还是在 SSL/gRPC/Node.js/Lubuntu 上。我相信我的机器是最有可能的问题。以下是相关软件:
- Node.js 8.10.04
- Lubuntu 18.04
我很感谢任何反馈,谢谢。