Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install missing dependencies in angular 10

I am using apollo in my angular 10 and I have this problem after running ng serve

ERROR in The target entry-point "apollo-angular" has missing dependencies:

  • @angular/core
  • apollo-client
  • rxjs
  • rxjs/operators
  • apollo-link

Is there a command to install all this missing dependencies in my project...even though I think I have installed all these..strange that I have these errors. Can someone shine some wisdom in me,thank you in advance

like image 366
PureAbap Avatar asked Dec 14 '22 08:12

PureAbap


1 Answers

I had the same issue for '@apollo/client/core'

ERROR in The target entry-point "apollo-angular" has missing dependencies:

@apollo/client/core

The import from "@apollo/client/core" in apollo.d.ts didn't work properly. Downgrading apollo-angular to 1.10.0 solved the issue. The documentation says it has the support for Angular 10. The import in apollo.d.ts in this version looks like below:

import { ApolloClient, QueryOptions, MutationOptions, ApolloQueryResult, SubscriptionOptions, ApolloClientOptions } from 'apollo-client';

This is how the dependencies in my package.json look like:

"apollo-angular": "^1.10.0",
"apollo-angular-link-http": "^1.11.0",
"apollo-cache-inmemory": "^1.6.6",
"apollo-client": "^2.6.10",
"apollo-link": "^1.2.14",
"graphql": "^15.1.0",
"graphql-tag": "^2.10.4",
like image 113
pawel.gruszczyk Avatar answered Mar 08 '23 11:03

pawel.gruszczyk