我的package.json文件
编号列表很简单
{ “ name”:“ cal-euc”, “ version”:“ 0.0.0”, “脚本”:{ “ ng”:“ ng”, “ start”:“ ng服务”, “ build”:“ ng build”, “ test”:“ ng test”, “ lint”:“ ng lint”, “ e2e”:“ ng e2e” }, “私人”:是的, “依赖关系”:{ “ @ angular / animations”:“ ^ 7.0.1”, “ @ angular / common”:“ ^ 7.0.1”, “ @ angular / compiler”:“ ^ 7.0.1”, “ @ angular / core”:“ ^ 7.0.1”, “ @ angular / forms”:“ ^ 7.0.1”, “ @ angular / http”:“ ^ 7.0.1”, “ @ angular / platform-browser”:“ ^ 7.0.1”, “ @ angular / platform-browser-dynamic”:“ ^ 7.0.1”, “ @ angular / router”:“ ^ 7.0.1”, “ core-js”:“ ^ 2.5.4”, “ rxjs”:“ ^ 6.0.0”, “ rxjs-compat”:“ ^ 6.5.4”, “ zone.js”:“〜0.8.26” }, “ devDependencies”:{ “ @ angular-devkit / build-angular”:“ ^ 0.803.25”, “ @ angular / cli”:“ ^ 8.3.25”, “ @ angular / compiler-cli”:“ ^ 7.0.1”, “ @ angular / language-service”:“ ^ 7.0.1”, “ @ types / jasmine”:“〜2.8.6”, “ @ types / jasminewd2”:“〜2.0.3”, “ @ types / node”:“〜8.9.4”, “ codelyzer”:“〜4.2.1”, “茉莉花芯”:“〜2.99.1”, “ jasmine-spec-reporter”:“〜4.2.1”, “业力”:“ ^ 4.4.1”, “ karma-chrome-launcher”:“〜2.2.0”, “业力报废的伊斯坦布尔记者”:“〜2.0.0”, “业力茉莉花”:“〜1.1.1”, “ karma-jasmine-html-reporter”:“ ^ 0.2.2”, “量角器”:“〜5.4.0”, “ ts-node”:“〜5.0.1”, “ tslint”:“〜5.9.1”, “打字稿”:“〜3.1.3” } }
答案 0 :(得分:2)
我有同样的问题。这是因为angular-cli版本大于angular版本,并且compiler-cli不兼容。 我将angular-cli版本降级到7,现在我的项目可以正常工作了。
我找不到其他解决方案。
npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli@7.3.9
致谢