我正在将应用程序从 Angular 8升级到9 。我使用了以下命令。
ng update @angular/core@9 @angular/cli@9 -allow-dirty --force
我收到软件包'-y'不是依赖项 错误消息,我不知道出了什么问题。
随附的屏幕截图供您参考。
屏幕截图
package.json 文件
{
"name": "xxxx",
"version": "1.0.0",
"private": true,
"scripts": {
"ng": "ng",
"build": "npm run env -s && ng build --prod",
"start": "npm run env -s && ng serve --aot --proxy-config proxy.conf.js",
"serve:sw": "npm run build -s && npx http-server ./dist -p 4200",
"lint": "ng lint && stylelint \"src/**/*.scss\" --syntax scss && htmlhint \"src\" --config .htmlhintrc",
"test": "npm run env -s && ng test",
"test:ci": "npm run env -s && npm run lint -s && ng test --code-coverage --watch=false",
"e2e": "npm run env -s && ng e2e",
"translations:extract": "ngx-translate-extract --input ./src --output ./src/translations/template.json --format=json --clean -sort --marker extract",
"docs": "hads ./docs -o",
"env": "ngx-scripts env npm_package_version",
"prettier": "prettier --write \"./{src,e2e}/**/*.{ts,js,scss}\"",
"prettier:check": "prettier --list-different \"./{src,e2e}/**/*.{ts,js,scss}\"",
"postinstall": "npm run prettier -s",
"precommit": "pretty-quick --staged",
"generate": "ng generate"
},
"dependencies": {
"@angular/animations": "^8.2.14",
"@angular/cdk": "^8.2.2",
"@angular/common": "^8.2.14",
"@angular/compiler": "^8.2.14",
"@angular/core": "^8.2.14",
"@angular/flex-layout": "^8.0.0-beta.27",
"@angular/forms": "^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",
"@angular/service-worker": "^8.2.14",
"@fortawesome/fontawesome-free-webfonts": "^1.0.9",
"@ng-bootstrap/ng-bootstrap": "^3.3.1",
"@ngx-translate/core": "^10.0.1",
"@progress/kendo-angular-common": "^1.2.1",
"@progress/kendo-angular-dropdowns": "^4.2.2",
"@progress/kendo-angular-l10n": "^2.0.0",
"@progress/kendo-angular-popup": "^3.0.3",
"angular-archwizard": "^5.0.0",
"angular-user-idle": "^2.2.2",
"angular2-notifications": "^2.0.0",
"angular5-csv": "^0.2.11",
"bootstrap": "^4.1.1",
"core-js": "^2.5.6",
"font-awesome": "^4.7.0",
"highcharts": "^8.0.0",
"jquery": "^3.4.1",
"lodash": "^4.17.10",
"mat-table-exporter": "^1.2.5",
"ng-multiselect-dropdown": "0.2.3",
"ng2-toastr": "^4.1.2",
"ng6-toastr-notifications": "^1.0.4",
"ngx-pagination": "^4.1.0",
"ngx-perfect-scrollbar": "^8.0.0",
"ngx-select-dropdown": "^1.2.1",
"ngx-select-ex": "^3.7.3",
"ngx-toastr": "^10.1.0",
"ngx-ui-loader": "^7.2.2",
"rxjs": "^6.6.3",
"rxjs-compat": "^6.5.3",
"save": "^2.4.0",
"slavede-ng-dual-list-box": "^1.1.5",
"zone.js": "^0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.803.24",
"@angular/cli": "~8.3.29",
"@angular/compiler-cli": "^8.2.14",
"@angular/language-service": "^8.2.14",
"@biesbjerg/ngx-translate-extract": "^2.3.4",
"@ngx-rocket/scripts": "^3.0.0",
"@types/jasmine": "^2.8.7",
"@types/jasminewd2": "^2.0.2",
"@types/lodash": "^4.14.108",
"@types/node": "^8.10.13",
"codelyzer": "^4.4.4",
"hads": "^1.7.0",
"htmlhint": "^0.10.0",
"https-proxy-agent": "^2.0.0",
"husky": "^0.14.3",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "^4.1.0",
"karma": "~3.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^2.0.2",
"karma-jasmine": "^1.1.2",
"karma-junit-reporter": "^1.2.0",
"node-sass": "^4.13.0",
"prettier": "^1.14.0",
"pretty-quick": "^1.6.0",
"protractor": "~5.4.0",
"rebuild-node-sass": "^1.1.0",
"stylelint": "~9.6.0",
"stylelint-config-prettier": "^4.0.0",
"stylelint-config-recommended-scss": "~3.2.0",
"stylelint-config-standard": "~18.2.0",
"stylelint-scss": "~3.3.0",
"ts-node": "~7.0.1",
"tslint": "~5.11.0",
"tslint-config-prettier": "^1.14.0",
"typescript": "~3.5.3"
},
"prettier": {
"singleQuote": true,
"overrides": [
{
"files": "*.scss",
"options": {
"singleQuote": false
}
}
]
}
}
如果您需要package.json文件以外的任何文件,请告诉我
有人,请帮帮我。
答案 0 :(得分:1)
问题出在您的命令中。而不是-allow-dirty
,它应该是--allow-dirty
(两个前划线)。
ng update @angular/core@9 @angular/cli@9 --allow-dirty --force
# ^^