Angular Material 和 CDK 更新 7 到 8 迁移失败

Bri*_*ley 5 angular-material angular angular-cdk

我正在尝试将 angular material 和 cdk 从版本 7 更新到 8。包更新对两者都很好,但是每次迁移都失败,并出现一个非常“有用”的错误

无法读取未定义迁移失败的属性“绿色”。有关更多详细信息,请参见上文。

我很难追踪这可能来自哪里。我在我的项目中对“绿色”进行了通用搜索,但一无所获。我已经擦除了我的 node_modules 并重新安装,但继续得到这个。

我什至在尝试单独执行迁移时得到了这个

ng update @angular/material@8 --migrationOnly=true --from=7 --to=8
Run Code Online (Sandbox Code Playgroud)

任何建议/帮助将不胜感激。

Sim*_*mon 5

同样的错误在这里。日志指向 onMigrationComplete() in .\node_modules\@angular\material\schematics\ng-update\index.js,所以我删除了对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.'));
    }
}
Run Code Online (Sandbox Code Playgroud)

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.');
    }
}
Run Code Online (Sandbox Code Playgroud)

使用 AFTER 版本,迁移贯穿始终