Har*_*vic 3 electron electron-builder
我们正在努力构建适用于 Windows 32 位和 64 位的应用程序。
\n\n它是 Angular 2 应用程序,使用 sqlite3 作为数据库。
\n\n开发中一切工作正常,但打包应用程序并在 Windows 上运行后,它会抛出错误
\n\nSQLite package has not been found installed. Try to install it: npm install sqlite3 --save\nRun Code Online (Sandbox Code Playgroud)\n\n这是 package.json (其中一部分对于这个问题很重要):
\n\n "scripts": {\n "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",\n "build:aot": "npm run build:aot:prod",\n "build:dev": "npm run clean:dist && npm run webpack -- --config config/webpack.dev.js --progress --profile",\n "build:docker": "npm run build:prod && docker build -t angular2-webpack-start:latest .",\n "build:prod": "npm run clean:dist && npm run webpack -- --config config/webpack.prod.js --progress --profile --bail",\n "build": "npm run build:dev",\n "ci:aot": "npm run lint && npm run test && npm run build:aot && npm run e2e",\n "ci:jit": "npm run lint && npm run test && npm run build:prod && npm run e2e",\n "ci:nobuild": "npm run lint && npm test && npm run e2e",\n "ci:testall": "npm run lint && npm run test && npm run build:prod && npm run e2e && npm run build:aot && npm run e2e",\n "ci:travis": "npm run lint && npm run test && npm run build:aot && npm run e2e:travis",\n "ci": "npm run ci:testall",\n "clean:dll": "npm run rimraf -- dll",\n "clean:aot": "npm run rimraf -- compiled",\n "clean:dist": "npm run rimraf -- dist",\n "clean:install": "npm set progress=false && npm install",\n "clean": "npm cache clean --force && npm run rimraf -- node_modules doc coverage dist compiled dll",\n "docker": "docker",\n "docs": "npm run typedoc -- --options typedoc.json --exclude \'**/*.spec.ts\' ./src/",\n "e2e:live": "npm-run-all -p -r server:prod:ci protractor:live",\n "e2e:travis": "npm-run-all -p -r server:prod:ci protractor:delay",\n "e2e": "npm-run-all -p -r server:prod:ci protractor",\n "github-deploy:dev": "npm run webpack -- --config config/webpack.github-deploy.js --progress --profile --env.githubDev",\n "github-deploy:prod": "npm run webpack -- --config config/webpack.github-deploy.js --progress --profile --env.githubProd",\n "github-deploy": "npm run github-deploy:dev",\n "lint": "npm run tslint \\"src/**/*.ts\\"",\n "node": "node",\n "postinstall": "install-app-deps && electron-rebuild",\n "postversion": "git push && git push --tags",\n "preclean:install": "npm run clean",\n "preversion": "npm test",\n "protractor": "protractor",\n "protractor:delay": "sleep 3 && npm run protractor",\n "protractor:live": "protractor --elementExplorer",\n "rimraf": "rimraf",\n "server:dev:hmr": "npm run server:dev -- --inline --hot",\n "server:dev": "npm run webpack-dev-server -- --config config/webpack.dev.js --progress --profile --watch --content-base src/",\n "server:prod": "http-server dist -c-1 --cors",\n "server:prod:ci": "http-server dist -p 3000 -c-1 --cors",\n "server": "npm run server:dev",\n "start:hmr": "npm run server:dev:hmr",\n "start": "npm run server:dev",\n "test": "npm run lint && karma start",\n "tslint": "tslint",\n "typedoc": "typedoc",\n "version": "npm run build",\n "watch:dev:hmr": "npm run watch:dev -- --hot",\n "watch:dev": "npm run build:dev -- --watch",\n "watch:prod": "npm run build:prod -- --watch",\n "watch:test": "npm run test -- --auto-watch --no-single-run",\n "watch": "npm run watch:dev",\n "electron:pre": "copyfiles main.js dist && copyfiles package.json dist && copyfiles ./icons/* ./dist && npm --prefix ./dist install ./dist --production",\n "electron:dev": "cross-env NODE_ENV=development electron .",\n "electron:prod": "npm run build:aot:prod && npm run electron:pre && electron ./dist",\n "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",\n "electron:windows": "npm run build:aot:prod && npm run electron:pre && electron-builder install-app-deps --platform=win32 && node package.js --asar --platform=win32",\n "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",\n "webdriver-manager": "webdriver-manager",\n "webdriver:start": "npm run webdriver-manager start",\n "webdriver:update": "webdriver-manager update",\n "webpack-dev-server": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js",\n "webpack": "node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js"\n },\n "dependencies": {\n "node-pre-gyp": "^0.6.38",\n "sqlite3": "^3.1.9",\n "typeorm": "0.1.0-alpha.49",\n "uikit": "^3.0.0-beta.30"\n },\n "devDependencies": {\n "@angular/animations": "~4.3.1",\n "@angular/common": "~4.3.1",\n "@angular/compiler": "~4.3.1",\n "@angular/compiler-cli": "~4.3.1",\n "@angular/core": "~4.3.1",\n "@angular/forms": "~4.3.1",\n "@angular/http": "~4.3.1",\n "@angular/platform-browser": "~4.3.1",\n "@angular/platform-browser-dynamic": "~4.3.1",\n "@angular/platform-server": "~4.3.1",\n "@angular/router": "~4.3.1",\n "@angularclass/hmr": "~1.2.2",\n "@angularclass/hmr-loader": "^3.0.4",\n "@ngrx/effects": "^4.0.5",\n "@ngrx/store": "^4.0.3",\n "@types/hammerjs": "^2.0.34",\n "@types/jasmine": "2.5.45",\n "@types/node": "^7.0.39",\n "@types/source-map": "^0.5.0",\n "@types/uglify-js": "^2.6.28",\n "@types/webpack": "^2.2.16",\n "add-asset-html-webpack-plugin": "^1.0.2",\n "angular2-template-loader": "^0.6.2",\n "assets-webpack-plugin": "^3.5.1",\n "awesome-typescript-loader": "~3.1.2",\n "codelyzer": "~2.1.1",\n "copy-webpack-plugin": "^4.0.1",\n "copyfiles": "^1.2.0",\n "core-js": "^2.4.1",\n "cross-env": "^5.0.0",\n "css-loader": "^0.28.0",\n "electron": "1.7.5",\n "electron-builder": "^19.27.7",\n "electron-packager": "8.7.2",\n "electron-rebuild": "^1.6.0",\n "electron-reload": "^1.1.0",\n "exports-loader": "^0.6.4",\n "expose-loader": "^0.7.3",\n "extract-text-webpack-plugin": "~2.1.0",\n "file-loader": "^0.11.1",\n "find-root": "^1.0.0",\n "gh-pages": "^1.0.0",\n "html-webpack-plugin": "^2.28.0",\n "http-server": "^0.9.0",\n "ie-shim": "^0.1.0",\n "imports-loader": "^0.7.1",\n "inline-manifest-webpack-plugin": "^3.0.1",\n "istanbul-instrumenter-loader": "2.0.0",\n "jasmine-core": "^2.5.2",\n "jquery": "^3.2.1",\n "karma": "^1.6.0",\n "karma-chrome-launcher": "^2.0.0",\n "karma-coverage": "^1.1.1",\n "karma-jasmine": "^1.1.0",\n "karma-mocha-reporter": "^2.2.3",\n "karma-remap-coverage": "^0.1.4",\n "karma-sourcemap-loader": "^0.3.7",\n "karma-webpack": "^2.0.4",\n "less": "^2.7.2",\n "less-loader": "^4.0.5",\n "ng-router-loader": "^2.1.0",\n "ngc-webpack": "^3.2.0",\n "node-sass": "^4.5.2",\n "npm-run-all": "^4.0.2",\n "optimize-js-plugin": "0.0.4",\n "parse5": "^3.0.2",\n "preload-webpack-plugin": "^1.2.2",\n "protractor": "^5.1.1",\n "raw-loader": "0.5.1",\n "reflect-metadata": "^0.1.10",\n "rimraf": "~2.6.1",\n "rxjs": "~5.0.2",\n "sass-loader": "^6.0.3",\n "script-ext-html-webpack-plugin": "^1.8.5",\n "source-map-loader": "^0.2.1",\n "string-replace-loader": "~1.2.0",\n "style-loader": "^0.18.1",\n "to-string-loader": "^1.1.5",\n "ts-node": "^3.3.0",\n "tslib": "^1.7.1",\n "tslint": "~4.5.1",\n "tslint-loader": "^3.5.2",\n "typedoc": "^0.7.1",\n "typescript": "2.5.0",\n "uglify-js": "git://github.com/mishoo/UglifyJS2#harmony-v2.8.22",\n "uglifyjs-webpack-plugin": "0.4.3",\n "url-loader": "^0.5.8",\n "webpack": "~2.6.1",\n "webpack-dev-middleware": "^1.10.1",\n "webpack-dev-server": "~2.4.2",\n "webpack-dll-bundles-plugin": "^1.0.0-beta.5",\n "webpack-merge": "~4.1.0",\n "zone.js": "0.8.14"\n },\nRun Code Online (Sandbox Code Playgroud)\n\n运行后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
\n\n> angular-electron-starter@1.0.0 electron:windows /home/haris/development/walter/bitbucket-\n> npm run build:aot:prod && npm run electron:pre && electron-builder install-app-deps --platform=win32 && node package.js --asar --platform=win32\n\n\n> angular-electron-starter@1.0.0 build:aot:prod /home/haris/development/walter/bitbucket-\n> npm run clean:dist && npm run clean:aot && cross-env BUILD_AOT=1 npm run webpack -- --config config/webpack.prod.js --progress --profile --bail\n\n\n> angular-electron-starter@1.0.0 clean:dist /home/haris/development/walter/bitbucket-\n> npm run rimraf -- dist\n\n\n> angular-electron-starter@1.0.0 rimraf /home/haris/development/walter/bitbucket-\n> rimraf "dist"\n\n\n> angular-electron-starter@1.0.0 clean:aot /home/haris/development/walter/bitbucket-\n> npm run rimraf -- compiled\n\n\n> angular-electron-starter@1.0.0 rimraf /home/haris/development/walter/bitbucket-\n> rimraf "compiled"\n\n\n> angular-electron-starter@1.0.0 webpack /home/haris/development/walter/bitbucket-\n> node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js "--config" "config/webpack.prod.js" "--progress" "--profile" "--bail"\n\nStarting compilation using the angular compiler.\nAngular compilation done, starting webpack bundling.\n 0% compiling\n 10% building modules 0/1 modules 1 active ...ntent-manager/src/main.browser.aot.ts\n 10% building modules 0/2 modules 2 active ...tent-manager/src/polyfills.browser.ts\n[at-loader] Using typescript@2.5.0 from typescript and "tsconfig.json" from /home/haris/development/walter/bitbucket-/tsconfig.webpack.json.\n\n\n 10% building modules 1/2 modules 1 active ...tent-manager/src/polyfills.browser.ts\n\n# I removed building modules proccess because of limit of characters on stackoverflow.\n\n\n25067ms additional asset processing\n 92% chunk asset optimization\n3538ms chunk asset optimization\n 94% asset optimization\n[at-loader] Checking started in a separate process...\n\n[at-loader] Ok, 2.38 sec.\n\n2788ms asset optimization\n 95% emitting\n18ms emitting\nHash: a3f29d769fb284afcae1\nVersion: webpack 2.6.1\nTime: 62001ms\n [emitted] \n\n\nWARNING in ./~/typeorm/platform/PlatformTools.js\n33:19-32 Critical dependency: the request of a dependency is an expression\n\nWARNING in ./~/typeorm/platform/PlatformTools.js\n37:23-85 Critical dependency: the request of a dependency is an expression\nChild html-webpack-plugin for "index.html":\n [3IRH] (webpack)/buildin/module.js 517 bytes {0} [built]\n [] -> factory:36ms building:174ms = 210ms\n [7GO9] ./~/html-webpack-plugin/lib/loader.js!./src/index.html 2.2 kB {0} [built]\n factory:6ms building:11ms = 17ms\n [DuR2] (webpack)/buildin/global.js 509 bytes {0} [built]\n [] -> factory:36ms building:174ms = 210ms\n [M4fF] ./~/lodash/lodash.js 540 kB {0} [built]\n [] -> factory:83ms building:3556ms = 3639ms\nChild extract-text-webpack-plugin:\n [9rjH] ./~/css-loader!./src/styles/headings.css 166 bytes {0} [built]\n factory:2ms building:17ms = 19ms\n [FZ+f] ./~/css-loader/lib/css-base.js 2.26 kB {0} [built]\n [] -> factory:0ms building:2ms = 2ms\nChild extract-text-webpack-plugin:\n [FZ+f] ./~/css-loader/lib/css-base.js 2.26 kB {0} [built]\n [] -> factory:0ms building:1ms = 1ms\n [pZge] ./~/css-loader!./~/less-loader/dist/cjs.js!./src/styles/styles.less 256 kB {0} [built]\n factory:3ms building:5063ms = 5066ms\n\n> angular-electron-starter@1.0.0 electron:pre /home/haris/development/walter/bitbucket-\n> copyfiles main.js dist && copyfiles package.json dist && copyfiles ./icons/* ./dist && npm --prefix ./dist install ./dist --production\n\n\n> sqlite3@3.1.13 install /home/haris/development/walter/bitbucket-/dist/node_modules/sqlite3\n> node-pre-gyp install --fallback-to-build\n\n[sqlite3] Success: "/home/haris/development/walter/bitbucket-/dist/node_modules/sqlite3/lib/binding/node-v48-linux-x64/node_sqlite3.node" is installed via remote\n\n> angular-electron-starter@1.0.0 postinstall /home/haris/development/walter/bitbucket-/dist\n> install-app-deps && electron-rebuild\n\nWarning: Please use as subcommand: electron-builder install-app-deps\nelectron-builder 19.36.0\nRebuilding native production dependencies for linux:x64\n\xe2\x9c\x94 Rebuild Complete\nangular-electron-starter@1.0.0 /home/haris/development/walter/bitbucket-/dist\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\xac node-pre-gyp@0.6.38 \n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\xac hawk@3.1.3 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 boom@2.10.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 cryptiles@2.0.5 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 hoek@2.16.3 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 sntp@1.0.9 \n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\xac mkdirp@0.5.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 minimist@0.0.8 \n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\xac nopt@4.0.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 abbrev@1.1.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\xac osenv@0.1.4 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 os-homedir@1.0.2 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 os-tmpdir@1.0.2 \n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\xac npmlog@4.1.2 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\xac are-we-there-yet@1.1.4 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 delegates@1.0.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 console-control-strings@1.1.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\xac gauge@2.7.4 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 aproba@1.2.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 has-unicode@2.0.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 object-assign@4.1.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 signal-exit@3.0.2 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\xac string-width@1.0.2 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 code-point-at@1.1.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\xac is-fullwidth-code-point@1.0.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 number-is-nan@1.0.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\xac strip-ansi@3.0.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 ansi-regex@2.1.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 wide-align@1.1.2 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 set-blocking@2.0.0 \n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\xac rc@1.2.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 deep-extend@0.4.2 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 ini@1.3.4 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 minimist@1.2.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 strip-json-comments@2.0.1 \n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\xac request@2.81.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 aws-sign2@0.6.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 aws4@1.6.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 caseless@0.12.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\xac combined-stream@1.0.5 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 delayed-stream@1.0.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 extend@3.0.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 forever-agent@0.6.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\xac form-data@2.1.4 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 asynckit@0.4.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\xac har-validator@4.2.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\xac ajv@4.11.8 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 co@4.6.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\xac json-stable-stringify@1.0.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 jsonify@0.0.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 har-schema@1.0.5 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\xac http-signature@1.1.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 assert-plus@0.2.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\xac jsprim@1.4.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 assert-plus@1.0.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 extsprintf@1.3.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 json-schema@0.2.3 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\xac verror@1.10.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 assert-plus@1.0.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\xac sshpk@1.13.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 asn1@0.2.3 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 assert-plus@1.0.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 bcrypt-pbkdf@1.0.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\xac dashdash@1.14.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 assert-plus@1.0.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 ecc-jsbn@0.1.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\xac getpass@0.1.7 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 assert-plus@1.0.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 jsbn@0.1.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 tweetnacl@0.14.5 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 is-typedarray@1.0.0 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 isstream@0.1.2 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 json-stringify-safe@5.0.1 \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\xac mime-types@2.1.17 \
SQLite3 是原生 Node.js 模块,因此如果不将其重建为目标 Electron,则无法直接与 Electron 一起使用。 Electron 构建器将为我们的平台构建原生模块,然后我们可以像平常一样在代码中使用它。
以下是您需要遵循的步骤。
首先,我们需要在 package.json 中添加安装后步骤:
"scripts": {
"postinstall": "install-app-deps"
...
}
Run Code Online (Sandbox Code Playgroud)
然后安装必要的依赖项并构建:
npm install --save-dev electron-builder
npm install --save sqlite3
npm run postinstall
Run Code Online (Sandbox Code Playgroud)
我在 Windows 7(32 位)和 Windows 10(64 位)中使用了相同的过程。我在这方面没有遇到任何问题。
| 归档时间: |
|
| 查看次数: |
4138 次 |
| 最近记录: |