安装
@angular/pwa
出现错误:
$ ng add @angular/pwa --project angular-tic-tac-toe
ℹ Using package manager: npm
✔ Found compatible package version: @angular/[email protected].
✔ Package information loaded.
The package @angular/[email protected] will be installed and executed.
Would you like to proceed? Yes
✔ Packages successfully installed.
A dynamic import callback was not specified.
第二次运行出现
Segmentation fault
错误。
为什么会发生这种事?这是我的
package.json
:
{
"name": "angular-tic-tac-toe",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "^15.1.0",
"@angular/cdk": "^15.0.0",
"@angular/common": "^15.1.0",
"@angular/compiler": "^15.1.0",
"@angular/core": "^15.1.0",
"@angular/forms": "^15.1.0",
"@angular/platform-browser": "^15.1.0",
"@angular/platform-browser-dynamic": "^15.1.0",
"@angular/router": "^15.1.0",
"@nebular/eva-icons": "11.0.0",
"@nebular/theme": "^11.0.0",
"eva-icons": "^1.1.3",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.12.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^15.1.4",
"@angular/cli": "~15.1.4",
"@angular/compiler-cli": "^15.1.0",
"@schematics/angular": "~15.1.4",
"@types/jasmine": "~4.3.0",
"jasmine-core": "~4.5.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"typescript": "~4.9.4"
}
}
将您的应用程序更新到最新的 Angular 稳定版本,即 15.1.4 -> 15.2.11 您可以根据您的情况使用以下命令
ng update @angular/cli@15 @angular/cli@15
已测试并工作!