我正试图在我的笔记本电脑中安装aws示例演示https://github.com/aws-samples/amazon-chime-sdk-classroom-demo所需的所有npm软件包。但是当我想要运行时,总是得到类似的错误
npm install
我有点好奇,是不是因为我刚刚得到了我的,所以我得到了错误的npm和节点版本
错误代码显示
npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @typescript-eslint/eslint-plugin@2.34.0
npm ERR! Found: eslint@8.4.1
npm ERR! node_modules/eslint
npm ERR! dev eslint@"^8.4.1" from the root project
npm ERR! peer eslint@"*" from @typescript-eslint/experimental-utils@2.34.0
npm ERR! node_modules/@typescript-eslint/experimental-utils
npm ERR! @typescript-eslint/experimental-utils@"2.34.0" from @typescript-eslint/eslint-plugin@2.34.0
npm ERR! node_modules/@typescript-eslint/eslint-plugin
npm ERR! dev @typescript-eslint/eslint-plugin@"^2.17.0" from the root project
npm ERR! 1 more (eslint-config-airbnb-typescript)
npm ERR! @typescript-eslint/experimental-utils@"2.34.0" from @typescript-eslint/parser@2.34.0
npm ERR! node_modules/@typescript-eslint/parser
npm ERR! dev @typescript-eslint/parser@"^2.17.0" from the root project
npm ERR! 2 more (@typescript-eslint/eslint-plugin, eslint-config-airbnb-typescript)
npm ERR! 1 more (eslint-plugin-jest)
npm ERR! 7 more (babel-eslint, eslint-config-prettier, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^5.0.0 || ^6.0.0" from @typescript-eslint/eslint-plugin@2.34.0
npm ERR! node_modules/@typescript-eslint/eslint-plugin
npm ERR! dev @typescript-eslint/eslint-plugin@"^2.17.0" from the root project
npm ERR! peer @typescript-eslint/eslint-plugin@"^2.7.0" from eslint-config-airbnb-typescript@6.3.2
npm ERR! node_modules/eslint-config-airbnb-typescript
npm ERR! dev eslint-config-airbnb-typescript@"^6.3.1" from the root project
npm ERR! 1 more (eslint-config-erb)
npm ERR!
npm ERR! Conflicting peer dependency: eslint@6.8.0
npm ERR! node_modules/eslint
npm ERR! peer eslint@"^5.0.0 || ^6.0.0" from @typescript-eslint/eslint-plugin@2.34.0
npm ERR! node_modules/@typescript-eslint/eslint-plugin
npm ERR! dev @typescript-eslint/eslint-plugin@"^2.17.0" from the root project
npm ERR! peer @typescript-eslint/eslint-plugin@"^2.7.0" from eslint-config-airbnb-typescript@6.3.2
npm ERR! node_modules/eslint-config-airbnb-typescript
npm ERR! dev eslint-config-airbnb-typescript@"^6.3.1" from the root project
npm ERR! 1 more (eslint-config-erb)
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/liycheng/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/liycheng/.npm/_logs/2022-06-18T00_11_27_159Z-debug-0.log
我的节点版本和npm版本是:
$ npm -v
8.9.0
$ node -v
v18.2.0
我试图通过以下方式解决依赖冲突
npm install --legacy-peer-deps
但这不起作用
发布于 2022-06-18 06:41:57
上面提到的项目存储库包含yarn.lock
文件,而不包含package-lock.json
。更多的是在package.json
中定义了许多纱线命令。因此,上述项目是由yarn
发起的。因此,您需要使用yarn
命令而不是npm
。
对于第一个检查,您是否在您的计算机上安装了yarn
。使用yarn check
。如果没有安装,那么使用yarn
安装npm install --global yarn
。然后使用yarn install --immutable --immutable-cache --check-cache
做一个清洁安装。当您使用npm ci
时,它是一个类似于npm
的命令。
若要了解更多关于纱线检查的信息,请参阅纱线文档
发布于 2022-06-18 00:29:31
演示是使用纱线作为包管理器构建的,因此我建议您使用纱线而不是npm来构建和运行应用程序。
npm install --global yarn
yarn install
yarn start
如果它有效,那么npm安装失败的原因很可能是存储在yarn.lock文件中的一些附加信息,这些信息在使用npm构建时没有进行评估。
https://stackoverflow.com/questions/72665820
复制相似问题