ng add apollo-angular它发出了一些警告:
UPDATE src/app/app.module.ts (541 bytes)
npm WARN notsup Unsupported engine for extract-files@9.0.0: wanted: {"node":"^10.17.0 || ^12.0.0 || >= 13.7.0"} (current: {"node":"10.16.3","npm":"6.12.0"})
npm WARN notsup Not compatible with your version of node/npm: extract-files@9.0.0
npm WARN karma-jasmine-html-reporter@1.5.4 requires a peer of jasmine-core@>=3.5 but none is installed. You must install peer dependencies yourself.
npm WARN @apollo/client@3.1.3 requires a peer of react@^16.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN @apollo/client@3.1.3 requires a peer of subscriptions-transport-ws@^0.9.0 but none is installed. You must install peer dependencies yourself.因此,在添加对等依赖项之后,我尝试再添加一次阿波罗角:
MIA-LT-16354:src SSilwal$ ng add apollo-angular
Skipping installation: Package already installed
? Url to your GraphQL endpoint https://o5x5jzoo7z.sse.codesandbox.io/graphql'
Couldn't read tsconfig.base.json!环境:
@阿波罗/客户: 3.0.0阿波罗-角:2.0.3石墨cli:15.3.0@角/核心:9.1.7@角/cli: 9.1.12打字本:3.8.3
发布于 2021-04-04 13:00:30
这个问题通常发生在您的角度项目之前进行版本迁移时,因此tsconfig.base.json丢失或无效。
您可以尝试在正式文档自身指导下手动安装apollo-angular。
阿波罗角官方导轨在无角度示意图下安装apollo-angular
或者按照下面提到的这个手册更新:
这个问题的作者提出的Github问题提供了一个修正,只更新了角版本,先试试这个。
在我面临这个问题的时候,使用下面的命令帮助了一些人,但没有解决我的问题
这是免费的尝试
ng update @angular/cli --migrate-only --from 9 --to 10
ng update @angular/core --migrate-only --from 9 --to 10或者尝试使用--如果你遇到错误就使用武力(小心使用!!)
它是解决因迁移角度版本而引起的tsconfig.base.json问题的解决方案
主要资料来源:与此问题有关的Github问题
注意到它有一些副作用,
在安古拉官方博士上阅读更多关于如何正确迁移的内容,了解项目的复杂程度
我亲自使用这个命令来安装所需的所有软件包,并继续使用指南添加所需的模块。
ng update apollo-angular --migrate-only --from 1.10.0或者尝试使用--如果你遇到错误就使用武力(小心使用!!)
ng update apollo-angular --migrate-only --from 1.10.0 --force
我希望这有助:)
在一些国家,如伊朗,您可能需要使用代理来使用ng add apollo-angular
https://stackoverflow.com/questions/63618211
复制相似问题