をフェッチする際に「protobuf.js」をロードできません:次の端末ルールベアボーンノードファイル実行Firestoreドキュメント
Firestore (4.5.2) 2017-10-18T19:16:47.719Z: INTERNAL UNHANDLED ERROR: Error: Failed to fetch file at /.../project/node_modules/protobufjs/dist/protobuf.js:5164:30 at ReadFileContext.callback (/.../p/node_modules/protobufjs/dist/protobuf.js:358:29) at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:420:13) (node:43981) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Failed to fetch file (node:43981) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
で
const firebase = require("firebase");
const http = require('http')
require("firebase/firestore");
firebase.initializeApp({
apiKey: '...',
authDomain: '...',
databaseURL: '...',
serviceAccount: '...',
projectId: '...'
});
var db = firebase.firestore();
var userRef = db.collection('...').doc('...');
結果をしかし、私はnode_modulesフォルダをチェックし、それがあります。私もそれを再インストールしようとしました、そして、他の人はprotobuf.jsの現在のバージョンで問題を抱えていないようです。
今日は同じ問題が発生しています。同様のアプローチを示し、出力と構成を文書化するために以下の回答を追加しました。 – Krispy