Tutorial error: "ajv-keywords@3.5.2 requires a peer of ajv@^6.9.1"

I’m trying to follow the tutorial at Get started with Apollo Client - Apollo GraphQL Docs
but when I run
npm install @apollo/client graphql
I get

npm WARN ajv-keywords@3.5.2 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.

And when I run
npm install 'ajv@^6.9.1'
I get

npm WARN @apideck/better-ajv-errors@0.3.6 requires a peer of ajv@>=8 but none is installed. You must install peer dependencies yourself.

My output of
npm list -g --depth=0.
is

/usr/local/lib
└── npm@6.14.14

And when I run
npm install 'ajv@>=8'
I get

npm WARN ajv-keywords@3.5.2 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.

Is this just a warning, or are you actually experiencing issues? Warnings like this can also come up by dependencies that would be used by code paths that are just never accessed.

Ah, not sure; I ended up deleting and fully purging npm and all packages and starting over, and that seemed to work.