electronでsqliteのモジュールを使用したいのですが、以下のエラーで使用できません。
Uncaught Error: Cannot find module '/Users/username/Documents/hatenaEle/node_modules/sqlite3/lib/binding/electron-v1.4-darwin-x64/node_sqlite3.node'
インストールは以下のコマンドを使用しました。
npm install sqlite3
以下のインストールログを見ると正常にインストールできてるように思えます。
hoge$ npm install sqlite3 > sqlite3@3.1.8 install /Users/username/Documents/hatenaEle/node_modules/sqlite3 > node-pre-gyp install --fallback-to-build node-pre-gyp info it worked if it ends with ok node-pre-gyp verb cli [ '/usr/local/Cellar/node/8.2.1/bin/node', node-pre-gyp verb cli '/Users/username/Documents/hatenaEle/node_modules/sqlite3/node_modules/.bin/node-pre-gyp', node-pre-gyp verb cli 'install', node-pre-gyp verb cli '--fallback-to-build' ] node-pre-gyp info using node-pre-gyp@0.6.31 node-pre-gyp info using node@8.2.1 | darwin | x64 node-pre-gyp verb command install [] node-pre-gyp info check checked for "/Users/username/Documents/hatenaEle/node_modules/sqlite3/lib/binding/node-v57-darwin-x64/node_sqlite3.node" (not found) node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.8/node-v57-darwin-x64.tar.gz node-pre-gyp http 200 https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.8/node-v57-darwin-x64.tar.gz node-pre-gyp info install unpacking node_sqlite3.node node-pre-gyp info tarball done parsing tarball node-pre-gyp info validate Running test command: '/usr/local/Cellar/node/8.2.1/bin/node --eval 'require(\'/Users/username/Documents/hatenaEle/node_modules/sqlite3/lib/binding/node-v57-darwin-x64/node_sqlite3.node\')'' [sqlite3] Success: "/Users/username/Documents/hatenaEle/node_modules/sqlite3/lib/binding/node-v57-darwin-x64/node_sqlite3.node" is installed via remote node-pre-gyp info ok npm WARN electronApp@1.0.0 No repository field.
const sqlite3 = require("sqlite3");
しようとするとエラーになります。
sqlite3を使用するさいは他モジュールもインストールしなければならないのでしょうか?
わかるかたいらっしゃいましたらご教授お願いします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。