微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

安装 @nuxtjs/apollo

如何解决安装 @nuxtjs/apollo

我对终端/CMD 不是特别有信心,我在通过 npx create-nuxt-app 设置 Nuxt 项目后尝试安装 Nuxt 的 Apollo 模块。当我这样做时,通过我的 Nuxt 目录中的 npm install @nuxtjs/apollo@latest,我得到以下 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":"x64"})

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

我做错了什么?

解决方法

如果您是:

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

然后您可以安全地继续。在这里,您只有警告,而且这是 JS 世界中的日常例行公事。没什么好担心的。

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。