我使用 npm 安装了 agm/core,如下所示:
npm install @agm/core
Run Code Online (Sandbox Code Playgroud)
显示以下警告:
npm WARN @agm/core@3.0.0-beta.0 requires a peer of @angular/common@^9.1.0 || ^10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @agm/core@3.0.0-beta.0 requires a peer of @angular/core@^9.1.0 || ^10.0.0 but none is installed. You must install peer dependencies yourself.
Run Code Online (Sandbox Code Playgroud)
尽管如此,我还是继续按照如下文档将 AgmCoreModule 导入 AppModule:
AgmCoreModule.forRoot({
apiKey: 'MY MAP KEY',
libraries: ['places']
})
Run Code Online (Sandbox Code Playgroud)
但是,当尝试使用ng serve为应用程序提供服务时,会出现以下错误:
Error: node_modules/@agm/core/lib/services/google-maps-api-wrapper.d.ts:50:41 - error TS2314: Generic type 'MapHandlerMap<T>' requires 1 type argument(s).
50 subscribeToMapEvent<N …Run Code Online (Sandbox Code Playgroud) 在我的 Angular 应用程序中,我需要添加google map. 我遇到了两个库,不知道该使用哪一个
npm install @angular/google-maps
npm install @agm/core --save
Run Code Online (Sandbox Code Playgroud)
谁能告诉我哪一个是最新的并且易于开发,或者两者都是相同的。
我想开发这种类型的地图
我正在开发一个 Angular 组件库,自从更新到 Angular 13 以来,npm i @our/library@14.1.1-beta.1我们的库出现了一些错误:
npm ERR! While resolving: test-app@0.0.0
npm ERR! Found: @angular/common@13.2.7
npm ERR! node_modules/@angular/common
npm ERR! @angular/common@"~13.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^6.0.0 || ^7.0.0 || ^8.0.0" from @agm/core@1.1.0
npm ERR! node_modules/@agm/core
npm ERR! peer @agm/core@"^1.1.0" from @our/library@14.1.1-beta.1
npm ERR! node_modules/@our/library
npm ERR! @our/library@"14.1.1-beta.1" from the root project
Run Code Online (Sandbox Code Playgroud)
所以在我看来,它@agm/core@1.1.0具有@angular/common@"^6.0.0 || ^7.0.0 || ^8.0.0"与 不兼容的依赖项@angular/common@"~13.2.0"。那是对的吗?
我尝试将@angular/common@8.0.0 …