首页 > 解决方案 > 安装 @nuxtjs/apollo 时的 NPM 警告

问题描述

我对终端/CMD 不是很有信心,并且在通过npx create-nuxt-app. 当我这样做时,通过npm install @nuxtjs/apollo@latest在我的 Nuxt 目录中,我得到以下 gumf:

npm WARN tailwindcss@2.2.2 requires a peer of autoprefixer@^10.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN vue-cli-plugin-apollo@0.22.2 requires a peer of @vue/cli-shared-utils@^3.0.0 || ^4.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN apollo-link-persisted-queries@0.2.2 requires a peer of graphql@^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ts-node@8.10.2 requires a peer of typescript@>=2.7 but none is installed. You must install peer dependencies yourself.
npm WARN @apollographql/graphql-language-service-interface@2.0.2 requires a peer of graphql@^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @apollographql/graphql-language-service-utils@2.0.2 requires a peer of graphql@^0.12.0 || ^0.13.0 || ^14.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @apollographql/graphql-language-service-types@2.0.2 requires a peer of graphql@^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @apollographql/graphql-language-service-parser@2.0.2 requires a peer of graphql@^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\watchpack-chokidar2\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

我不知道这是否重要。然后它邀请我运行npm audit fix,我这样做了,然后它告诉我它能够修复 15 个问题中的 0 个,并且它们需要手动修复。

我究竟做错了什么?

标签: npmcommand-linegraphqlnuxt.jsapollo

解决方案


如果你是:

  • 对 CLI 命令没有信心
  • 使用 NPM 而不是纱线(仔细检查你的项目中没有任何东西yarn.lock
  • 没有任何关键问题

然后,您可以安全地进行。在这里,你只有警告,这是 JS 世界的日常。没什么好担心的。

此外,如果您能够在控制台(浏览器和 CLI)中运行项目而不会出现任何错误,那么您就可以开始了!


推荐阅读