Обновление Angular Material v15 - не удалось: ts.getDecorators не является функцией

Я пытаюсь обновить библиотеку и продемонстрировать проект до Angular Material v15. Нет проблем с обновлением до Angular, но когда я запускаю ng update @angular/material@15 --force, я получаю сообщение об ошибке Migration failed: ts.getDecorators is not a function Это полное сообщение Это все, что есть в журнале ошибок:

[error] TypeError: ts.getDecorators is not a function
    at ComponentResourceCollector._visitClassDeclaration (C:\my-project\Lib-my-project-Grid\my-projectGrid\node_modules\@angular\cdk\schematics\update-tool\component-resource-collector.js:40:31)
    at ComponentResourceCollector.visitNode (C:\my-project\Lib-my-project-Grid\my-projectGrid\node_modules\@angular\cdk\schematics\update-tool\component-resource-collector.js:36:18)
    at visitNodeAndCollectResources (C:\my-project\Lib-my-project-Grid\my-projectGrid\node_modules\@angular\cdk\schematics\update-tool\index.js:83:31)
    at visitNodes (C:\my-project\Lib-my-project-Grid\my-projectGrid\node_modules\typescript\lib\typescript.js:30672:30)
    at Object.forEachChild (C:\my-project\Lib-my-project-Grid\my-projectGrid\node_modules\typescript\lib\typescript.js:30951:24)
    at visitNodeAndCollectResources (C:\my-project\Lib-my-project-Grid\my-projectGrid\node_modules\@angular\cdk\schematics\update-tool\index.js:82:16)
    at C:\my-project\Lib-my-project-Grid\my-projectGrid\node_modules\@angular\cdk\schematics\update-tool\index.js:92:17
    at Array.forEach (<anonymous>)
    at UpdateProject.migrate (C:\my-project\Lib-my-project-Grid\my-projectGrid\node_modules\@angular\cdk\schematics\update-tool\index.js:87:21)
    at runMigrations (C:\my-project\Lib-my-project-Grid\my-projectGrid\node_modules\@angular\cdk\schematics\ng-update\devkit-migration-rule.js:122:42)

**Дополнительная информация: я должен использовать --force флаг, потому что на момент этого вопроса @angular/flex-layount v15 все еще находится в ожидании PR. Обновление Ng завершается ошибкой из-за одноранговой зависимости.

Кроме того, когда я снова пытаюсь запустить ng update, я получаю сообщение Package '@angular/material' is already up to date., которое отражено в моем package.json.
Однако, когда я пытаюсь запустить только миграцию, после установки npm (ng update @angular/material@15 --migrate-only) я получаю сообщение об ошибке package is not installed

Это мой package.json на случай, если это поможет:

{
  "name": "lib-omega-grid",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test",
    "build_lib": "npm run set_node_max_size && node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build my-lib-grid-lib --configuration=production",
    "set_node_max_size": "set NODE_OPTIONS=--max-old-space-size=8192",
    "npm_pack": "cd dist/my-lib-grid-lib && npm pack",
    "publish": "cd dist/my-lib-grid-lib && npm publish --ignore-scripts",
    "package": "npm run build_lib && npm run npm_pack",
    "package_no": "npm run build_lib && npm run npm_pack",
    "clean": "rmdir /s /q node_modules",
    "package_test": "npm run build_lib && npm run npm_pack"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^15.0.3",
    "@angular/cdk": "^15.0.2",
    "@angular/common": "^15.0.3",
    "@angular/compiler": "^15.0.3",
    "@angular/core": "^15.0.3",
    "@angular/elements": "^15.0.3",
    "@angular/flex-layout": "14.0.0-beta.40",
    "@angular/forms": "^15.0.3",
    "@angular/localize": "^15.0.3",
    "@angular/material": "^15.0.2",
    "@angular/material-moment-adapter": "^15.0.2",
    "@angular/platform-browser": "^15.0.3",
    "@angular/platform-browser-dynamic": "^15.0.3",
    "@angular/router": "^15.0.3",
    "@biesbjerg/ngx-translate-extract": "7.0.3",
    "@danielmoncada/angular-datetime-picker": "^15.0.0",
    "@microsoft/signalr": "5.0.11",
    "@ngrx/effects": "^15.0.0",
    "@ngrx/store": "^15.0.0",
    "@ngx-translate/core": "~14.0.0",
    "@ngx-translate/http-loader": "~7.0.0",
    "@my-lib/notifications": "9.0.4",
    "@splitsoftware/splitio": "10.22.2",
    "@thebespokepixel/es-tinycolor": "^2.1.1",
    "@types/express": "^4.17.13",
    "core-js": "3.25.0",
    "document-register-element": "1.14.10",
    "file-saver": "2.0.5",
    "html2canvas": "^1.0.0-rc.7",
    "jspdf": "^2.4.0",
    "jspdf-autotable": "^3.5.23",
    "logrocket": "3.0.1",
    "material-community-components": "10.0.0",
    "material-design-icons": "3.0.1",
    "material-design-icons-iconfont": "6.1.0",
    "moment": "2.29.4",
    "moment-timezone": "0.5.37",
    "oidc-client": "1.11.5",
    "rxjs": "~7.5.0",
    "tinycolor2": "^1.4.2",
    "tslib": "^2.3.0",
    "xlsx": "^0.17.5",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^15.0.3",
    "@angular-devkit/core": "^15.0.3",
    "@angular-eslint/builder": "14.0.2",
    "@angular-eslint/eslint-plugin": "14.0.2",
    "@angular-eslint/eslint-plugin-template": "14.0.2",
    "@angular-eslint/schematics": "14.0.2",
    "@angular-eslint/template-parser": "14.0.2",
    "@angular/cli": "~15.0.3",
    "@angular/compiler-cli": "^15.0.3",
    "@angular/language-service": "^15.0.3",
    "@types/html2canvas": "0.0.36",
    "@types/jasmine": "~4.0.0",
    "@types/jasminewd2": "~2.0.8",
    "@typescript-eslint/eslint-plugin": "5.36.1",
    "@typescript-eslint/parser": "5.36.1",
    "eslint": "^8.18.0",
    "eslint-plugin-import": "latest",
    "eslint-plugin-jsdoc": "latest",
    "eslint-plugin-prefer-arrow": "latest",
    "jasmine-core": "~4.3.0",
    "jasmine-spec-reporter": "7.0.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",
    "ng-packagr": "^14.2.0",
    "typescript": "~4.7.2"
  }
}
Тестирование функциональных ngrx-эффектов в Angular 16 с помощью Jest
В системе управления состояниями ngrx, совместимой с Angular 16, появились функциональные эффекты. Это здорово и делает код определенно легче для...
Angular и React для вашего проекта веб-разработки?
Angular и React для вашего проекта веб-разработки?
Когда дело доходит до веб-разработки, выбор правильного front-end фреймворка имеет решающее значение. Angular и React - два самых популярных...
Эпизод 23/17: Twitter Space о будущем Angular, Tiny Conf
Эпизод 23/17: Twitter Space о будущем Angular, Tiny Conf
Мы провели Twitter Space, обсудив несколько проблем, связанных с последними дополнениями в Angular. Также прошла Angular Tiny Conf с 25 докладами.
Угловой продивер
Угловой продивер
Оригинал этой статьи на турецком языке. ChatGPT используется только для перевода на английский язык.
Мое недавнее углубление в Angular
Мое недавнее углубление в Angular
Недавно я провел некоторое время, изучая фреймворк Angular, и я хотел поделиться своим опытом со всеми вами. Как человек, который любит глубоко...
Освоение Observables и Subjects в Rxjs:
Освоение Observables и Subjects в Rxjs:
Давайте начнем с основ и постепенно перейдем к более продвинутым концепциям в RxJS в Angular
1
0
519
1
Перейти к ответу Данный вопрос помечен как решенный

Ответы 1

Ответ принят как подходящий

После обсуждения на канале Angular Discord мне было предложено обновить мою машинописную версию до 4.8.2. После этого обновление материала и миграция заработали!

https://discord.com/channels/748677963142135818/1051985021562523778/1051985021562523778

Другие вопросы по теме