SQLite package has not been found installed! while using with typeorm
See original GitHub issueDescribe the bug
I have typeorm , sqlite3 installed
have invoked vue invoke electron-builder
still the browser outputs -
DriverPackageNotInstalledError: SQLite package has not been found installed. Try to install it: npm install sqlite3 --save at new DriverPackageNotInstalledError (webpack-internal:///./node_modules/typeorm/browser/error/DriverPackageNotInstalledError.js:11:28) at SqliteDriver.loadDependencies (webpack-internal:///./node_modules/typeorm/browser/driver/sqlite/SqliteDriver.js:126:19) at new SqliteDriver (webpack-internal:///./node_modules/typeorm/browser/driver/sqlite/SqliteDriver.js:32:15) at DriverFactory.create (webpack-internal:///./node_modules/typeorm/browser/driver/DriverFactory.js:51:24) at new Connection (webpack-internal:///./node_modules/typeorm/browser/connection/Connection.js:74:98) at ConnectionManager.create (webpack-internal:///./node_modules/typeorm/browser/connection/ConnectionManager.js:59:26) at eval (webpack-internal:///./node_modules/typeorm/browser/index.js:499:66) at step (webpack-internal:///./node_modules/tslib/tslib.es6.js:123:23) at Object.eval [as next] (webpack-internal:///./node_modules/tslib/tslib.es6.js:104:53) at eval (webpack-internal:///./node_modules/tslib/tslib.es6.js:97:71)
i even added -
module.exports = { pluginOptions: { electronBuilder: { // List native deps here if they don’t work externals: [‘sqlite3’], // If you are using Yarn Workspaces, you may have multiple node_modules folders // List them all here so that VCP Electron Builder can find them nodeModulesPath: [‘…/…/node_modules’, ‘./node_modules’] } }, chainWebpack: config => { config.merge({ externals: { sqlite3: ‘commonjs sqlite3’ } }) } };
to the vue.config.js
Environment (please complete the following information):
- OS and version: MacOS
- node version: 12.14.0
- npm version: 6.10.3
- yarn version (if used):
- vue-cli-plugin-electron-builder version : @latest
- electron version: 6.0.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
You need to add
typeorm
as an external. When I set thevue.config.js
to the following, it worked fine:thanks a lot it worked