Angular创建项目运行后提示ERROR in TypeError: Cannot read property 'flags' of undefined

发布于 4 年前 作者 phonegap100 1993 次浏览 最后一次编辑是 4 年前 来自 分享

Angular创建项目运行后提示ERROR in TypeError: Cannot read property ‘flags’ of undefined如何解决

ERROR in TypeError: Cannot read property 'flags' of undefined
    at resolveAlias (D:\ionic\angulardemo\node_modules\_typescript@3.8.3@typescript\lib\typescript.js:36513:37)
    at checkAliasSymbol (D:\ionic\angulardemo\node_modules\_typescript@3.8.3@typescript\lib\typescript.js:64502:26)
    at checkImportBinding (D:\ionic\angulardemo\node_modules\_typescript@3.8.3@typescript\lib\typescript.js:64534:13)

官方更新后,typescript版本不见人导致的

解决办法 把package.json中的

"@angular/cli": "~9.1.4",
"typescript": "~3.8.3"

替换为

 "@angular/cli": "~7.0.6",
"typescript": "~3.1.6"

然后把node_modules删掉 然后重新 cnpm i安装依赖 安装完成依赖后重试

回到顶部