Приложение Electron Пакет SQLITE не найден установленным

Мы боремся с созданием приложения для 32-битной и 64-битной Windows.

Это приложение angular 2, которое использует sqlite3 в качестве базы данных.

Все отлично работает в разработке, но после упаковки приложения и запуска его в Windows выдает ошибку

SQLite package has not been found installed. Try to install it: npm install sqlite3 --save

Вот package.json (часть его, которая важна для этой проблемы):

 "scripts": {
    "build:aot:prod": "npm run clean:dist && npm run clean:aot && cross-env BUILD_AOT=1 npm run webpack -- --config config/webpack.prod.js  --progress --profile --bail",
    "build:aot": "npm run build:aot:prod",
    "build:dev": "npm run clean:dist && npm run webpack -- --config config/webpack.dev.js --progress --profile",
    "build:docker": "npm run build:prod && docker build -t angular2-webpack-start:latest .",
    "build:prod": "npm run clean:dist && npm run webpack -- --config config/webpack.prod.js  --progress --profile --bail",
    "build": "npm run build:dev",
    "ci:aot": "npm run lint && npm run test && npm run build:aot && npm run e2e",
    "ci:jit": "npm run lint && npm run test && npm run build:prod && npm run e2e",
    "ci:nobuild": "npm run lint && npm test && npm run e2e",
    "ci:testall": "npm run lint && npm run test && npm run build:prod && npm run e2e && npm run build:aot && npm run e2e",
    "ci:travis": "npm run lint && npm run test && npm run build:aot && npm run e2e:travis",
    "ci": "npm run ci:testall",
    "clean:dll": "npm run rimraf -- dll",
    "clean:aot": "npm run rimraf -- compiled",
    "clean:dist": "npm run rimraf -- dist",
    "clean:install": "npm set progress=false && npm install",
    "clean": "npm cache clean --force && npm run rimraf -- node_modules doc coverage dist compiled dll",
    "docker": "docker",
    "docs": "npm run typedoc -- --options typedoc.json --exclude '**/*.spec.ts' ./src/",
    "e2e:live": "npm-run-all -p -r server:prod:ci protractor:live",
    "e2e:travis": "npm-run-all -p -r server:prod:ci protractor:delay",
    "e2e": "npm-run-all -p -r server:prod:ci protractor",
    "github-deploy:dev": "npm run webpack -- --config config/webpack.github-deploy.js --progress --profile --env.githubDev",
    "github-deploy:prod": "npm run webpack -- --config config/webpack.github-deploy.js --progress --profile --env.githubProd",
    "github-deploy": "npm run github-deploy:dev",
    "lint": "npm run tslint \"src/**/*.ts\"",
    "node": "node",
    "postinstall": "install-app-deps && electron-rebuild",
    "postversion": "git push && git push --tags",
    "preclean:install": "npm run clean",
    "preversion": "npm test",
    "protractor": "protractor",
    "protractor:delay": "sleep 3 && npm run protractor",
    "protractor:live": "protractor --elementExplorer",
    "rimraf": "rimraf",
    "server:dev:hmr": "npm run server:dev -- --inline --hot",
    "server:dev": "npm run webpack-dev-server -- --config config/webpack.dev.js --progress --profile --watch --content-base src/",
    "server:prod": "http-server dist -c-1 --cors",
    "server:prod:ci": "http-server dist -p 3000 -c-1 --cors",
    "server": "npm run server:dev",
    "start:hmr": "npm run server:dev:hmr",
    "start": "npm run server:dev",
    "test": "npm run lint && karma start",
    "tslint": "tslint",
    "typedoc": "typedoc",
    "version": "npm run build",
    "watch:dev:hmr": "npm run watch:dev -- --hot",
    "watch:dev": "npm run build:dev -- --watch",
    "watch:prod": "npm run build:prod -- --watch",
    "watch:test": "npm run test -- --auto-watch --no-single-run",
    "watch": "npm run watch:dev",
    "electron:pre": "copyfiles main.js dist && copyfiles package.json dist && copyfiles ./icons/* ./dist && npm --prefix ./dist install ./dist --production",
    "electron:dev": "cross-env NODE_ENV=development electron .",
    "electron:prod": "npm run build:aot:prod && npm run electron:pre && electron ./dist",
    "electron:linux": "npm run build:aot:prod && npm run electron:pre && node package.js --asar --platform=linux --arch=x64 && cd dist && electron-builder install-app-deps --platform=linux --arch=x64",
    "electron:windows": "npm run build:aot:prod && npm run electron:pre && electron-builder install-app-deps --platform=win32 &&  node package.js --asar --platform=win32",
    "electron:mac": "npm run build:aot:prod && npm run electron:pre && node package.js --asar --platform=darwin --arch=x64 && cd dist && electron-builder install-app-deps --platform=darwin --arch=x64",
    "webdriver-manager": "webdriver-manager",
    "webdriver:start": "npm run webdriver-manager start",
    "webdriver:update": "webdriver-manager update",
    "webpack-dev-server": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js",
    "webpack": "node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js"
  },
  "dependencies": {
    "node-pre-gyp": "^0.6.38",
    "sqlite3": "^3.1.9",
    "typeorm": "0.1.0-alpha.49",
    "uikit": "^3.0.0-beta.30"
  },
  "devDependencies": {
    "@angular/animations": "~4.3.1",
    "@angular/common": "~4.3.1",
    "@angular/compiler": "~4.3.1",
    "@angular/compiler-cli": "~4.3.1",
    "@angular/core": "~4.3.1",
    "@angular/forms": "~4.3.1",
    "@angular/http": "~4.3.1",
    "@angular/platform-browser": "~4.3.1",
    "@angular/platform-browser-dynamic": "~4.3.1",
    "@angular/platform-server": "~4.3.1",
    "@angular/router": "~4.3.1",
    "@angularclass/hmr": "~1.2.2",
    "@angularclass/hmr-loader": "^3.0.4",
    "@ngrx/effects": "^4.0.5",
    "@ngrx/store": "^4.0.3",
    "@types/hammerjs": "^2.0.34",
    "@types/jasmine": "2.5.45",
    "@types/node": "^7.0.39",
    "@types/source-map": "^0.5.0",
    "@types/uglify-js": "^2.6.28",
    "@types/webpack": "^2.2.16",
    "add-asset-html-webpack-plugin": "^1.0.2",
    "angular2-template-loader": "^0.6.2",
    "assets-webpack-plugin": "^3.5.1",
    "awesome-typescript-loader": "~3.1.2",
    "codelyzer": "~2.1.1",
    "copy-webpack-plugin": "^4.0.1",
    "copyfiles": "^1.2.0",
    "core-js": "^2.4.1",
    "cross-env": "^5.0.0",
    "css-loader": "^0.28.0",
    "electron": "1.7.5",
    "electron-builder": "^19.27.7",
    "electron-packager": "8.7.2",
    "electron-rebuild": "^1.6.0",
    "electron-reload": "^1.1.0",
    "exports-loader": "^0.6.4",
    "expose-loader": "^0.7.3",
    "extract-text-webpack-plugin": "~2.1.0",
    "file-loader": "^0.11.1",
    "find-root": "^1.0.0",
    "gh-pages": "^1.0.0",
    "html-webpack-plugin": "^2.28.0",
    "http-server": "^0.9.0",
    "ie-shim": "^0.1.0",
    "imports-loader": "^0.7.1",
    "inline-manifest-webpack-plugin": "^3.0.1",
    "istanbul-instrumenter-loader": "2.0.0",
    "jasmine-core": "^2.5.2",
    "jquery": "^3.2.1",
    "karma": "^1.6.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-coverage": "^1.1.1",
    "karma-jasmine": "^1.1.0",
    "karma-mocha-reporter": "^2.2.3",
    "karma-remap-coverage": "^0.1.4",
    "karma-sourcemap-loader": "^0.3.7",
    "karma-webpack": "^2.0.4",
    "less": "^2.7.2",
    "less-loader": "^4.0.5",
    "ng-router-loader": "^2.1.0",
    "ngc-webpack": "^3.2.0",
    "node-sass": "^4.5.2",
    "npm-run-all": "^4.0.2",
    "optimize-js-plugin": "0.0.4",
    "parse5": "^3.0.2",
    "preload-webpack-plugin": "^1.2.2",
    "protractor": "^5.1.1",
    "raw-loader": "0.5.1",
    "reflect-metadata": "^0.1.10",
    "rimraf": "~2.6.1",
    "rxjs": "~5.0.2",
    "sass-loader": "^6.0.3",
    "script-ext-html-webpack-plugin": "^1.8.5",
    "source-map-loader": "^0.2.1",
    "string-replace-loader": "~1.2.0",
    "style-loader": "^0.18.1",
    "to-string-loader": "^1.1.5",
    "ts-node": "^3.3.0",
    "tslib": "^1.7.1",
    "tslint": "~4.5.1",
    "tslint-loader": "^3.5.2",
    "typedoc": "^0.7.1",
    "typescript": "2.5.0",
    "uglify-js": "git://github.com/mishoo/UglifyJS2#harmony-v2.8.22",
    "uglifyjs-webpack-plugin": "0.4.3",
    "url-loader": "^0.5.8",
    "webpack": "~2.6.1",
    "webpack-dev-middleware": "^1.10.1",
    "webpack-dev-server": "~2.4.2",
    "webpack-dll-bundles-plugin": "^1.0.0-beta.5",
    "webpack-merge": "~4.1.0",
    "zone.js": "0.8.14"
  },

После запуска npm run electron:windows все хорошо и вот вывод:

/home/haris/.nvm/versions/node/v6.9.4/bin/node /home/haris/.nvm/versions/node/v6.9.4/lib/node_modules/npm/bin/npm-cli.js запустить электрон :windows --scripts-prepend-node-path=auto

> [email protected] electron:windows /home/haris/development/walter/bitbucket-
> npm run build:aot:prod && npm run electron:pre && electron-builder install-app-deps --platform=win32 &&  node package.js --asar --platform=win32


> [email protected] build:aot:prod /home/haris/development/walter/bitbucket-
> npm run clean:dist && npm run clean:aot && cross-env BUILD_AOT=1 npm run webpack -- --config config/webpack.prod.js  --progress --profile --bail


> [email protected] clean:dist /home/haris/development/walter/bitbucket-
> npm run rimraf -- dist


> [email protected] rimraf /home/haris/development/walter/bitbucket-
> rimraf "dist"


> [email protected] clean:aot /home/haris/development/walter/bitbucket-
> npm run rimraf -- compiled


> [email protected] rimraf /home/haris/development/walter/bitbucket-
> rimraf "compiled"


> [email protected] webpack /home/haris/development/walter/bitbucket-
> node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js "--config" "config/webpack.prod.js" "--progress" "--profile" "--bail"

Starting compilation using the angular compiler.
Angular compilation done, starting webpack bundling.
  0% compiling
 10% building modules 0/1 modules 1 active ...ntent-manager/src/main.browser.aot.ts
 10% building modules 0/2 modules 2 active ...tent-manager/src/polyfills.browser.ts
[at-loader] Using [email protected] from typescript and "tsconfig.json" from /home/haris/development/walter/bitbucket-/tsconfig.webpack.json.


 10% building modules 1/2 modules 1 active ...tent-manager/src/polyfills.browser.ts

# I removed building modules proccess because of limit of characters on stackoverflow.


25067ms additional asset processing
 92% chunk asset optimization
3538ms chunk asset optimization
 94% asset optimization
[at-loader] Checking started in a separate process...

[at-loader] Ok, 2.38 sec.

2788ms asset optimization
 95% emitting
18ms emitting
Hash: a3f29d769fb284afcae1
Version: webpack 2.6.1
Time: 62001ms
     [emitted]         


WARNING in ./~/typeorm/platform/PlatformTools.js
33:19-32 Critical dependency: the request of a dependency is an expression

WARNING in ./~/typeorm/platform/PlatformTools.js
37:23-85 Critical dependency: the request of a dependency is an expression
Child html-webpack-plugin for "index.html":
    [3IRH] (webpack)/buildin/module.js 517 bytes {0} [built]
           [] -> factory:36ms building:174ms = 210ms
    [7GO9] ./~/html-webpack-plugin/lib/loader.js!./src/index.html 2.2 kB {0} [built]
            factory:6ms building:11ms = 17ms
    [DuR2] (webpack)/buildin/global.js 509 bytes {0} [built]
           [] -> factory:36ms building:174ms = 210ms
    [M4fF] ./~/lodash/lodash.js 540 kB {0} [built]
           [] -> factory:83ms building:3556ms = 3639ms
Child extract-text-webpack-plugin:
    [9rjH] ./~/css-loader!./src/styles/headings.css 166 bytes {0} [built]
            factory:2ms building:17ms = 19ms
    [FZ+f] ./~/css-loader/lib/css-base.js 2.26 kB {0} [built]
           [] -> factory:0ms building:2ms = 2ms
Child extract-text-webpack-plugin:
    [FZ+f] ./~/css-loader/lib/css-base.js 2.26 kB {0} [built]
           [] -> factory:0ms building:1ms = 1ms
    [pZge] ./~/css-loader!./~/less-loader/dist/cjs.js!./src/styles/styles.less 256 kB {0} [built]
            factory:3ms building:5063ms = 5066ms

> [email protected] electron:pre /home/haris/development/walter/bitbucket-
> copyfiles main.js dist && copyfiles package.json dist && copyfiles ./icons/* ./dist && npm --prefix ./dist install ./dist --production


> [email protected] install /home/haris/development/walter/bitbucket-/dist/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

[sqlite3] Success: "/home/haris/development/walter/bitbucket-/dist/node_modules/sqlite3/lib/binding/node-v48-linux-x64/node_sqlite3.node" is installed via remote

> [email protected] postinstall /home/haris/development/walter/bitbucket-/dist
> install-app-deps && electron-rebuild

Warning: Please use as subcommand: electron-builder install-app-deps
electron-builder 19.36.0
Rebuilding native production dependencies for linux:x64
✔ Rebuild Complete
[email protected] /home/haris/development/walter/bitbucket-/dist
├─┬ [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ └─┬ [email protected] 
│ │   ├── [email protected] 
│ │   └── [email protected] 
│ ├─┬ [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └── [email protected] 
│ │ ├── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├─┬ [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ └─┬ [email protected] 
│ │ │ │   └── [email protected] 
│ │ │ ├─┬ [email protected] 
│ │ │ │ └── [email protected] 
│ │ │ └── [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └── [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├─┬ [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ └─┬ [email protected] 
│ │ │ │   └── [email protected] 
│ │ │ └── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├─┬ [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ └─┬ [email protected] 
│ │ │ │   └── [email protected] 
│ │ │ └─┬ [email protected] 
│ │ │   ├── [email protected] 
│ │ │   ├── [email protected] 
│ │ │   ├── [email protected] 
│ │ │   ├─┬ [email protected] 
│ │ │   │ └── [email protected] 
│ │ │   ├── [email protected] 
│ │ │   ├─┬ [email protected] 
│ │ │   │ └── [email protected] 
│ │ │   ├── [email protected] 
│ │ │   └── [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └── [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └── [email protected] 
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └── [email protected] 
│ │ └── [email protected] 
│ └─┬ [email protected] 
│   ├─┬ [email protected] 
│   │ └── [email protected] 
│   ├── [email protected] 
│   ├─┬ [email protected] 
│   │ └── [email protected] 
│   ├─┬ [email protected] 
│   │ ├── [email protected] 
│   │ ├── [email protected] 
│   │ ├── [email protected] 
│   │ ├── [email protected] 
│   │ └── [email protected] 
│   └── [email protected] 
├── [email protected] 
├─┬ [email protected] 
│ └─┬ [email protected] 
│   ├── [email protected] 
│   ├── [email protected] 
│   ├─┬ [email protected] 
│   │ └─┬ [email protected] 
│   │   ├── [email protected] 
│   │   └── [email protected] 
│   └── [email protected] 
├─┬ [email protected] 
│ ├── [email protected] 
│ └─┬ [email protected] 
│   ├─┬ [email protected] 
│   │ ├── [email protected] 
│   │ ├── [email protected] 
│   │ ├── [email protected] 
│   │ └── [email protected] 
│   ├─┬ [email protected] 
│   │ └── [email protected] 
│   ├─┬ [email protected] 
│   │ ├── [email protected] 
│   │ └─┬ [email protected] 
│   │   ├── [email protected] 
│   │   └── [email protected] 
│   ├─┬ [email protected] 
│   │ ├─┬ [email protected] 
│   │ │ └── [email protected] 
│   │ ├── [email protected] 
│   │ ├─┬ [email protected] 
│   │ │ ├── [email protected] 
│   │ │ ├── [email protected] 
│   │ │ ├── [email protected] 
│   │ │ ├── [email protected] 
│   │ │ ├─┬ [email protected] 
│   │ │ │ ├── [email protected] 
│   │ │ │ └─┬ [email protected] 
│   │ │ │   └── [email protected] 
│   │ │ ├─┬ [email protected] 
│   │ │ │ └── [email protected] 
│   │ │ └── [email protected] 
│   │ └── [email protected] 
│   ├─┬ [email protected] 
│   │ ├── [email protected] 
│   │ ├── [email protected] 
│   │ ├── [email protected] 
│   │ └── [email protected] 
│   ├─┬ [email protected] 
│   │ ├── [email protected] 
│   │ ├── [email protected] 
│   │ ├── [email protected] 
│   │ ├─┬ [email protected] 
│   │ │ └── [email protected] 
│   │ ├── [email protected] 
│   │ ├── [email protected] 
│   │ ├─┬ [email protected] 
│   │ │ └── [email protected] 
│   │ ├─┬ [email protected] 
│   │ │ ├─┬ [email protected] 
│   │ │ │ ├── [email protected] 
│   │ │ │ └─┬ [email protected] 
│   │ │ │   └── [email protected] 
│   │ │ └── [email protected] 
│   │ ├─┬ [email protected] 
│   │ │ ├── [email protected] 
│   │ │ ├─┬ [email protected] 
│   │ │ │ ├── [email protected] 
│   │ │ │ ├── [email protected] 
│   │ │ │ ├── [email protected] 
│   │ │ │ └─┬ [email protected] 
│   │ │ │   └── [email protected] 
│   │ │ └─┬ [email protected] 
│   │ │   ├── [email protected] 
│   │ │   ├── [email protected] 
│   │ │   ├── [email protected] 
│   │ │   ├─┬ [email protected] 
│   │ │   │ └── [email protected] 
│   │ │   ├── [email protected] 
│   │ │   ├─┬ [email protected] 
│   │ │   │ └── [email protected] 
│   │ │   ├── [email protected] 
│   │ │   └── [email protected] 
│   │ ├── [email protected] 
│   │ ├── [email protected] 
│   │ ├── [email protected] 
│   │ ├─┬ [email protected] 
│   │ │ └── [email protected] 
│   │ ├── [email protected] 
│   │ ├── [email protected] 
│   │ ├── [email protected] 
│   │ ├── [email protected] 
│   │ ├── [email protected] 
│   │ ├─┬ [email protected] 
│   │ │ └── [email protected] 
│   │ ├── [email protected] 
│   │ └── [email protected] 
│   ├─┬ [email protected] 
│   │ └─┬ [email protected] 
│   │   ├── [email protected] 
│   │   ├── [email protected] 
│   │   ├─┬ [email protected] 
│   │   │ └─┬ [email protected] 
│   │   │   ├── [email protected] 
│   │   │   └── [email protected] 
│   │   └── [email protected] 
│   ├── [email protected] 
│   ├─┬ [email protected] 
│   │ ├── [email protected] 
│   │ ├─┬ [email protected] 
│   │ │ └── [email protected] 
│   │ └── [email protected] 
│   └─┬ [email protected] 
│     ├─┬ [email protected] 
│     │ └── [email protected] 
│     ├── [email protected] 
│     ├─┬ [email protected] 
│     │ └── [email protected] 
│     ├─┬ [email protected] 
│     │ ├── [email protected] 
│     │ ├── [email protected] 
│     │ ├── [email protected] 
│     │ ├── [email protected] 
│     │ └── [email protected] 
│     └── [email protected] 
├─┬ [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └─┬ [email protected] 
│ │ │   └── [email protected] 
│ │ ├── [email protected] 
│ │ └─┬ [email protected] 
│ │   └── [email protected] 
│ ├─┬ [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├── [email protected] 
│ │ │ └── [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├── [email protected] 
│ │ │ └─┬ [email protected] 
│ │ │   └── [email protected] 
│ │ └─┬ [email protected] 
│ │   ├── [email protected] 
│ │   ├── [email protected] 
│ │   ├─┬ [email protected] 
│ │   │ ├─┬ [email protected] 
│ │   │ │ ├── [email protected] 
│ │   │ │ └─┬ [email protected] 
│ │   │ │   └── [email protected] 
│ │   │ └─┬ [email protected] 
│ │   │   ├─┬ [email protected] 
│ │   │   │ └─┬ [email protected] 
│ │   │   │   └── [email protected] 
│ │   │   └── [email protected] 
│ │   ├── [email protected] 
│ │   ├── [email protected] 
│ │   └─┬ [email protected] 
│ │     └── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └── [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├── [email protected] 
│ │ │ └── [email protected] 
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ └─┬ [email protected] 
│   ├── [email protected] 
│   ├─┬ [email protected] 
│   │ └── [email protected] 
│   ├── [email protected] 
│   ├── [email protected] 
│   ├─┬ [email protected] 
│   │ ├─┬ [email protected] 
│   │ │ ├─┬ [email protected] 
│   │ │ │ ├─┬ [email protected] 
│   │ │ │ │ ├── [email protected] 
│   │ │ │ │ └── [email protected] 
│   │ │ │ ├─┬ [email protected] 
│   │ │ │ │ └── [email protected] 
│   │ │ │ └─┬ [email protected] 
│   │ │ │   └── [email protected] 
│   │ │ ├── [email protected] 
│   │ │ ├── [email protected] 
│   │ │ ├─┬ [email protected] 
│   │ │ │ └── [email protected] 
│   │ │ ├── [email protected] 
│   │ │ └── [email protected] 
│   │ ├─┬ [email protected] 
│   │ │ └── [email protected] 
│   │ └─┬ [email protected] 
│   │   └── [email protected] 
│   ├─┬ [email protected] 
│   │ ├─┬ [email protected] 
│   │ │ └─┬ [email protected] 
│   │ │   ├─┬ [email protected] 
│   │ │   │ └── [email protected] 
│   │ │   └── [email protected] 
│   │ └─┬ [email protected] 
│   │   ├─┬ [email protected] 
│   │   │ ├─┬ [email protected] 
│   │   │ │ └─┬ [email protected] 
│   │   │ │   └── [email protected] 
│   │   │ ├── [email protected] 
│   │   │ └── [email protected] 
│   │   ├─┬ [email protected] 
│   │   │ ├── [email protected] 
│   │   │ ├─┬ [email protected] 
│   │   │ │ └── [email protected] 
│   │   │ └─┬ [email protected] 
│   │   │   ├─┬ [email protected] 
│   │   │   │ └── [email protected] 
│   │   │   └── [email protected] 
│   │   └── [email protected] 
│   ├── [email protected] 
│   ├── [email protected] 
│   ├─┬ [email protected] 
│   │ ├── [email protected] 
│   │ └─┬ [email protected] 
│   │   └── [email protected] 
│   ├── [email protected] 
│   ├── [email protected] 
│   └── [email protected] 
└── [email protected] 

electron-builder 19.36.0
Rebuilding native production dependencies for win32:x64
Packaging app for platform win32 ia32 using electron v1.7.5
Packaging app for platform win32 x64 using electron v1.7.5
Application packaged successfully! [ 'app-builds/angular-electron-starter-win32-ia32',
  'app-builds/angular-electron-starter-win32-x64' ]

Process finished with exit code 0

Но когда я запускаю .exe в Windows, я получаю сообщение об ошибке, о которой я упоминал выше, что пакет sqlite не найден.


person Haris Hajdarevic    schedule 11.10.2017    source источник
comment
Та же проблема, с которой я столкнулся   -  person Redplane    schedule 13.06.2018


Ответы (1)


SQLite3 — это нативный модуль Node.js, поэтому его нельзя использовать напрямую с Electron, не перестраивая его для целевого Electron. Электрон-сборщик создаст нативный модуль для нашей платформы, и затем мы можем запросить его в коде, как обычно.

Ниже приведены шаги, которые необходимо выполнить.

Во-первых, нам нужно добавить шаг после установки в ваш package.json:

"scripts": {
   "postinstall": "install-app-deps"
   ...
    }

а затем установите необходимые зависимости и соберите:

npm install --save-dev electron-builder
npm install --save sqlite3
npm run postinstall

Я использовал эту же процедуру в Windows 7 (32-разрядная версия), а также в Windows 10 (64-разрядная версия). Я не сталкивался с какой-либо проблемой по этому поводу.

person Gireesh Kudipudi    schedule 18.07.2018