Angular Material 和 CDK 更新 7 到 8 迁移失败
Angular Material and CDK update 7 to 8 Migration Failure
我正在尝试将 angular material 和 cdk 从版本 7 更新到版本 8。包更新对两者都很好,但两者的迁移每次都失败,并出现非常 "helpful" 的错误
Cannot read property 'green' of undefined
Migration failed. See above for furhter details.
我很难追踪这可能来自何处。我在我的项目中对 "green" 进行了通用搜索,但一无所获。我已经擦除我的 node_modules 并重新安装,但继续得到这个。
我什至在尝试使用
单独执行迁移时得到了这个
ng update @angular/material@8 --migrationOnly=true --from=7 --to=8
任何 suggestions/help 将不胜感激。
同样的错误。日志指向 .\node_modules\@angular\material\schematics\ng-update\index.js
中的 onMigrationComplete(),因此我删除了对 chalk_1.default
的引用:
之前
function onMigrationComplete(targetVersion, hasFailures) {
console.log();
console.log(chalk_1.default.green(` ✓ Updated Angular Material to ${targetVersion}`));
console.log();
if (hasFailures) {
console.log(chalk_1.default.yellow(' ⚠ Some issues were detected but could not be fixed automatically. Please check the ' +
'output above and fix these issues manually.'));
}
}
之后
function onMigrationComplete(targetVersion, hasFailures) {
console.log();
console.log(` ✓ Updated Angular Material to ${targetVersion}`);
console.log();
if (hasFailures) {
console.log(' ⚠ Some issues were detected but could not be fixed automatically. Please check the ' +
'output above and fix these issues manually.');
}
}
对于 AFTER 版本,迁移贯穿
我正在尝试将 angular material 和 cdk 从版本 7 更新到版本 8。包更新对两者都很好,但两者的迁移每次都失败,并出现非常 "helpful" 的错误
Cannot read property 'green' of undefined Migration failed. See above for furhter details.
我很难追踪这可能来自何处。我在我的项目中对 "green" 进行了通用搜索,但一无所获。我已经擦除我的 node_modules 并重新安装,但继续得到这个。
我什至在尝试使用
单独执行迁移时得到了这个ng update @angular/material@8 --migrationOnly=true --from=7 --to=8
任何 suggestions/help 将不胜感激。
同样的错误。日志指向 .\node_modules\@angular\material\schematics\ng-update\index.js
中的 onMigrationComplete(),因此我删除了对 chalk_1.default
的引用:
之前
function onMigrationComplete(targetVersion, hasFailures) {
console.log();
console.log(chalk_1.default.green(` ✓ Updated Angular Material to ${targetVersion}`));
console.log();
if (hasFailures) {
console.log(chalk_1.default.yellow(' ⚠ Some issues were detected but could not be fixed automatically. Please check the ' +
'output above and fix these issues manually.'));
}
}
之后
function onMigrationComplete(targetVersion, hasFailures) {
console.log();
console.log(` ✓ Updated Angular Material to ${targetVersion}`);
console.log();
if (hasFailures) {
console.log(' ⚠ Some issues were detected but could not be fixed automatically. Please check the ' +
'output above and fix these issues manually.');
}
}
对于 AFTER 版本,迁移贯穿