Приложение построено за пару лет go с использованием:
- Angular v5.2.0
- Angular -CLI v1.6.4
- Electron v1.7.8
- Electron Builder v20.0.5
- Node 10.15.0
- NPM 6.4.1
- node-gyp 3.8.0
Последний раз он был скомпилирован в сентябре 2019 года, но теперь при запуске npm i
после клонирования из репо появляется следующая ошибка на электронном сборщике. Работает на Windows 10 и Visual Studio Code. У меня такая же ошибка на MacOS Catalina.
PS C:\[Project\directory]> npm i
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade t
> [projectname-version]-beta postinstall C:\Pinro\8track-player
> electron-builder install-app-deps
• electron-builder version=20.0.5
• loaded configuration file=C:[project\directory]\electron-builder.json
Error: Application directory dist doesn't exists
at C:\[project\directory]\node_modules\electron-builder-lib\src\util\config.ts:140:13
From previous event:
at computeDefaultAppDirectory (C:\[project\directory]\node_modules\electron-builder-lib\out\util\config.js:131:22)
at C:\[project\directory]\node_modules\electron-builder\src\cli\install-app-deps.ts:52:78
at Generator.next (<anonymous>)
From previous event:
at installAppDeps (C:\[project\directory]\node_modules\electron-builder\out\cli\install-app-deps.js:51:21)
at then (C:\[project\directory]\node_modules\electron-builder\src\cli\cli.ts:48:33)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
From previous event:
at Object.args [as handler] (C:\[project\directory]\node_modules\electron-builder\src\cli\cli.ts:48:33)
at Object.runCommand (C:\[project\directory]\node_modules\electron-builder\node_modules\yargs\lib\command.js:235:44
at Object.parseArgs [as _parseArgs] (C:\[project\directory]\node_modules\electron-builder\node_modules\yargs\yargs.
at Object.get [as argv] (C:\[project\directory]\node_modules\electron-builder\node_modules\yargs\yargs.js:965:21)
at Object.<anonymous> (C:\[project\directory]node_modules\electron-builder\src\cli\cli.ts:42:15)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [project-name-version]-beta postinstall: `electron-builder install-app-deps`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [project-name-version]-beta postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\[Project directory]\AppData\Roaming\npm-cache\_logs\2020-07-12T07_25_33_106Z-debug.log
PS C:\[Project\directory]>
пакет. json:
{
"name": "[project-name]",
"version": "[version-number]-beta",
"description": "",
"author": {
"name": "",
"email": ""
},
"keywords": [
"angular",
"angular 5",
"electron",
"typescript",
"sass"
],
"main": "main.js",
"private": true,
"scripts": {
"ng": "ng",
"lint": "ng lint",
"start": "tsc main.ts && npm-run-all --parallel webpack:watch electron:serve",
"webpack:watch": "webpack --watch",
"start:web": "webpack-dev-server --content-base . --port 4200 --inline",
"build:electron:main": "tsc main.ts --outDir dist && copyfiles package.json dist && cd dist && npm install --prod && cd ..",
"build": "webpack --display-error-details && npm run build:electron:main",
"build:prod": "cross-env NODE_ENV=production npm run build",
"electron:serve": "npm run build:electron:main && electron ./dist --serve",
"electron:test": "electron ./dist",
"electron:dev": "npm run build && electron ./dist",
"electron:prod": "npm run build:prod && electron ./dist",
"electron:linux": "npm run build:prod && npx electron-builder build --linux",
"electron:windows": "npm run build:prod && npx electron-builder build --windows",
"electron:mac": "npm run build:prod && npx electron-builder build --mac",
"rebuild": "electron-rebuild -f -w sqlite3 -v 1.8",
"test": "karma start ./karma.conf.js",
"pree2e": "webdriver-manager update --standalone false --gecko false --quiet && npm run build",
"e2e": "protractor ./protractor.conf.js",
"postinstall": "electron-builder install-app-deps"
},
"dependencies": {
"@types/bluebird": "3.5.20",
"electron-builder-squirrel-windows": "20.0.5",
"electron-rebuild": "^1.11.0",
"electron-squirrel-startup": "^1.0.0",
"sqlite3": "https://github.com/mapbox/node-sqlite3/tarball/master"
},
"devDependencies": {
"@angular-devkit/core": "^0.3.1",
"@angular/cli": "1.6.4",
"@angular/common": "5.2.0",
"@angular/compiler": "5.2.0",
"@angular/compiler-cli": "5.2.0",
"@angular/core": "5.2.0",
"@angular/forms": "5.2.0",
"@angular/http": "5.2.0",
"@angular/language-service": "5.2.0",
"@angular/platform-browser": "5.2.0",
"@angular/platform-browser-dynamic": "5.2.0",
"@angular/router": "5.2.0",
"@ng-bootstrap/ng-bootstrap": "1.1.1",
"@ngx-translate/core": "9.0.1",
"@ngx-translate/http-loader": "2.0.0",
"@types/core-js": "0.9.46",
"@types/jasmine": "2.5.54",
"@types/jasminewd2": "2.0.2",
"@types/lodash": "^4.14.50",
"@types/node": "^7.10.2",
"amplitudejs": "^3.2.3",
"autoprefixer": "7.1.4",
"bootstrap": "^4.0.0",
"chart.js": "^2.5.0",
"circular-dependency-plugin": "3.0.0",
"codelyzer": "3.2.0",
"copy-webpack-plugin": "4.1.1",
"copyfiles": "1.2.0",
"core-js": "2.4.1",
"cross-env": "5.0.5",
"crypto-js": "^3.1.9-1",
"css-loader": "0.28.7",
"cssnano": "3.10.0",
"diskspace": "^2.0.0",
"electron": "^1.8.8",
"electron-builder": "20.0.5",
"electron-builder-squirrel-windows": "20.0.5",
"electron-json-storage": "^4.0.2",
"electron-log": "^2.2.14",
"electron-reload": "1.2.2",
"electron-squirrel-startup": "^1.0.0",
"enhanced-resolve": "3.3.0",
"exports-loader": "0.6.4",
"file-loader": "1.1.5",
"html-loader": "0.5.1",
"html-webpack-plugin": "2.29.0",
"is-online": "^7.0.0",
"istanbul-instrumenter-loader": "3.0.0",
"jasmine-core": "2.8.0",
"jasmine-spec-reporter": "4.2.1",
"jquery": "^3.3.1",
"json-loader": "0.5.7",
"karma": "1.7.1",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "1.3.0",
"karma-jasmine": "1.1.0",
"karma-jasmine-html-reporter": "0.2.2",
"karma-sourcemap-loader": "0.3.7",
"less-loader": "4.0.5",
"minimist": "1.2.0",
"mkdirp": "0.5.1",
"node-cron": "^1.2.1",
"node-vibrant": "^3.0.0",
"npm-run-all": "^4.1.2",
"npx": "^9.7.1",
"os-name": "^2.0.1",
"popper.js": "^1.14.3",
"postcss-custom-properties": "6.2.0",
"postcss-loader": "2.0.6",
"postcss-url": "7.1.2",
"protractor": "5.1.2",
"raw-loader": "0.5.1",
"replace": "^0.3.0",
"rimraf": "^2.6.2",
"rxjs": "5.5.2",
"sass-loader": "6.0.6",
"script-loader": "0.7.1",
"source-map-loader": "0.2.1",
"style-loader": "0.18.2",
"stylus-loader": "3.0.1",
"ts-node": "3.3.0",
"tslint": "5.7.0",
"typescript": "2.6.2",
"uglifyjs-webpack-plugin": "1.0.0",
"url-loader": "0.6.2",
"wait-on": "^2.1.0",
"webdriver-manager": "12.0.6",
"webpack": "3.8.1",
"webpack-concat-plugin": "1.4.0",
"webpack-dev-server": "2.9.3",
"zone.js": "0.8.17"
},
"files": [
"*.js",
"build",
"node_modules"
],
"engines": {
"node": "10.15.0"
}
}
электронная сборка. json:
{
"productName": "[Project name]",
"appId": "[ID]",
"directories": {
"app": "dist",
"output": "app-builds"
},
"win": {
"icon": "dist/favicon",
"target": [
"squirrel"
]
},
"mac": {
"icon": "dist/favicon",
"target": [
"dmg"
]
},
"linux": {
"icon": "dist",
"target": [
"AppImage"
]
}
}
То, что я сделал до сих пор:
Windows 10:
- Установленный узел 10.15.0 и NPM 6.4.1
- node-gyp 3.8.0
- windows -build-tools
Не могли бы вы предложить какое-либо решение для запуска приложения? Заранее спасибо.
Журнал отладки ошибок - снимок экрана