简体   繁体   English

角度更新后无法启动电子角度应用程序

[英]Can't start an electron-angular app after an angular update

I'm trying to build an electron app using angular, TypeORM, SQLite and other component as webpack.我正在尝试使用 angular、TypeORM、SQLite 和其他组件作为 webpack 构建一个电子应用程序。

I started my development from an example I found at GitHub: https://github.com/CubikNeRubik/angular-electron-typeorm-starter .我从在 GitHub 上找到的一个示例开始我的开发: https : //github.com/CubikNeRubik/angular-electron-typeorm-starter

After a while, I decided to update angular from 8.0 to 8.2.一段时间后,我决定将 angular 从 8.0 更新到 8.2。 Then it was impossible to start my application.然后就无法启动我的应用程序。 I've got an error "ReferenceError: path is not defined".我有一个错误“ReferenceError:路径未定义”。

I restarted from beginning with the 8.0 version of angular.我从 8.0 版本的 angular 重新开始。 Without changing anything, the app start normally.无需更改任何内容,应用程序正常启动。

I upgraded the project using the "npm update" command.我使用“npm update”命令升级了项目。

Then I got this error:然后我得到了这个错误:

[error] ReferenceError: path is not defined
at Object.getBrowserConfig (/Volumes/Data/ProjetNodes/TestUpdate/node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js:62:22)
at webpack_browser_config_1.generateBrowserWebpackConfigFromContext.wco (/Volumes/Data/ProjetNodes/TestUpdate/node_modules/@angular-devkit/build-angular/src/browser/index.js:55:27)
at scriptTargets.map.scriptTarget (/Volumes/Data/ProjetNodes/TestUpdate/node_modules/@angular-devkit/build-angular/src/utils/webpack-browser-config.js:69:26)
at Array.map (<anonymous>)
at generateWebpackConfig (/Volumes/Data/ProjetNodes/TestUpdate/node_modules/@angular-devkit/build-angular/src/utils/webpack-browser-config.js:33:26)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

Could someone explain my wrongdoing?有人可以解释我的错误吗?

Here the modules version used before update:这里是更新前使用的模块版本:

"dependencies": {
    "sqlite3": "^4.0.9",
    "typeorm": "^0.2.18"
},
"devDependencies": {
    "@angular-builders/custom-webpack": "^8.0.2",
    "@angular-devkit/architect": "^0.800.3",
    "@angular-devkit/build-angular": "^0.800.3",
    "@angular-devkit/core": "^8.0.3",
    "@angular/animations": "^8.0.1",
    "@angular/cdk": "^8.0.1",
    "@angular/cli": "~8.0.3",
    "@angular/common": "^8.0.1",
    "@angular/compiler": "^8.0.1",
    "@angular/compiler-cli": "^8.0.1",
    "@angular/core": "^8.0.1",
    "@angular/forms": "^8.0.1",
    "@angular/http": "^7.0.0",
    "@angular/language-service": "^8.0.1",
    "@angular/material": "^8.0.1",
    "@angular/platform-browser": "^8.0.1",
    "@angular/platform-browser-dynamic": "^8.0.1",
    "@angular/router": "^8.0.1",
    "@types/node": "~12.0.8",
    "angular-cli-builders": "^2.1.2",
    "codelyzer": "~5.1.0",
    "commonjs": "0.0.1",
    "copy-webpack-plugin": "^5.0.3",
    "core-js": "^3.1.4",
    "electron": "^5.0.4",
    "electron-builder": "^20.44.2",
    "electron-reload": "^1.4.0",
    "fs": "0.0.1-security",
    "hammerjs": "^2.0.8",
    "npm-run-all": "4.1.5",
    "npx": "^10.2.0",
    "rxjs": "^6.5.2",
    "stream": "0.0.2",
    "ts-node": "~8.3.0",
    "tslint": "~5.17.0",
    "typescript": "^3.4.5",
    "wait-on": "3.2.0",
    "webpack": "^4.34.0",
    "zone.js": "^0.9.1"
}

The version after update:更新后的版本:

"dependencies": {
    "sqlite3": "^4.1.1",
    "typeorm": "^0.2.22"
},
"devDependencies": {
    "@angular-builders/custom-webpack": "^8.4.1",
    "@angular-devkit/architect": "^0.800.6",
    "@angular-devkit/build-angular": "^0.803.25",
    "@angular-devkit/core": "^8.3.25",
    "@angular/animations": "^8.2.14",
    "@angular/cdk": "^8.2.3",
    "@angular/cli": "~8.3.25",
    "@angular/common": "^8.2.14",
    "@angular/compiler": "^8.2.14",
    "@angular/compiler-cli": "^8.2.14",
    "@angular/core": "^8.2.14",
    "@angular/forms": "^8.2.14",
    "@angular/http": "^7.2.16",
    "@angular/language-service": "^8.2.14",
    "@angular/material": "^8.2.3",
    "@angular/platform-browser": "^8.2.14",
    "@angular/platform-browser-dynamic": "^8.2.14",
    "@angular/router": "^8.2.14",
    "@types/node": "^12.0.12",
    "angular-cli-builders": "^2.1.2",
    "codelyzer": "^5.1.2",
    "commonjs": "0.0.1",
    "copy-webpack-plugin": "^5.1.1",
    "core-js": "^3.6.4",
    "electron": "^5.0.13",
    "electron-builder": "^20.44.4",
    "electron-reload": "^1.5.0",
    "fs": "0.0.1-security",
    "hammerjs": "^2.0.8",
    "npm-run-all": "4.1.5",
    "npx": "^10.2.2",
    "rxjs": "^6.5.4",
    "stream": "0.0.2",
    "ts-node": "~8.3.0",
    "tslint": "~5.17.0",
    "typescript": "^3.5.3",
    "wait-on": "3.2.0",
    "webpack": "^4.41.6",
    "zone.js": "^0.9.1"
}

To those whom encounter the same issue here is my tournaround.对于那些在这里遇到同样问题的人来说,这是我的巡回赛。 I just add in the "node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js" file the code :我只是在“node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js”文件中添加代码:

const path = require("path");

et Voilà.等瞧。 h've a great day我今天过得很愉快

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM