1

私は gundb を使用して電子アプリに取り組んでいます。他のすべてが機能するようになった後、npm install --save gun. この警告で完了しました:

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14

私がしようとすると:

require('gun');
var endpoints;
var gun = Gun(endpoints);

それ以来、作成できないエラーの非常に長いリストが表示されます。それらは次のように始まります。

.../node_modules/fs doesn't exist
.../node_modules/fs.webpack.js doesn't exist
.../node_modules/fs.web.js doesn't exist
.../node_modules/fs.js doesn't exist
.../node_modules/fs.json doesn't exist

そして、以下は解決できません:

@ ./~/gun/lib/file.js 14:10-23
@ ./~/gun/lib/wsp.js 61:39-52
@ ./~/ws/lib/WebSocketServer.js 15:10-2
@ ./~/options/lib/options.js 6:9-2
@ ./~/aws-sdk/lib/api_loader.js 1:9-22
@ ./~/aws-sdk/lib/services.js 1:9-22

私はLinuxを使用しています。fsevent はガン npm の依存関係ですか?

UPDATE
できるだけ多くの他の変数を削除するために、package.jsonファイルを電子のみに減らしました....webpackおよびその他の依存関係で発生する可能性のある問題を排除しました。また、node_modules を削除し、新たに作成しましたnpm install & npm install gun

これにより、より有用なエラーが明らかになりました。

Uncaught ReferenceError: Gun is not defined                gun.js:1470

どちらが指摘したか:

if(typeof window !== "undefined"){ Gun.request = request }
if(typeof module !== "undefined" && module.exports){ module.exports.request = request }
4

2 に答える 2