whyboris/Video-Hub-App

Cannot npm install with latest version of npm (npm ERR! ERESOLVE could not resolve)

digeomel opened this issue ยท 6 comments

Hello, with:

 ~  node -v
v18.12.0
 ~  npm -v
9.1.2

When I try npm i I am getting (on Windows 10, although I don't believe it matters):

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! While resolving: an-qrcode@1.0.7
npm ERR! Found: @angular/common@14.2.8
npm ERR! node_modules/@angular/common
npm ERR!   dev @angular/common@"14.2.8" from the root project
npm ERR!   peer @angular/common@"^14.0.0 || ^15.0.0" from @angular/cdk@14.2.6
npm ERR!   node_modules/@angular/cdk
npm ERR!     dev @angular/cdk@"14.2.6" from the root project
npm ERR!     peer @angular/cdk@"14.2.6" from @angular/material@14.2.6
npm ERR!     node_modules/@angular/material
npm ERR!       dev @angular/material@"14.2.6" from the root project
npm ERR!   5 more (@angular/forms, @angular/material, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@">= 6.0.0 < 11.0.2" from an-qrcode@1.0.7
npm ERR! node_modules/an-qrcode
npm ERR!   an-qrcode@"1.0.7" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/common@11.0.1
npm ERR! node_modules/@angular/common
npm ERR!   peer @angular/common@">= 6.0.0 < 11.0.2" from an-qrcode@1.0.7
npm ERR!   node_modules/an-qrcode
npm ERR!     an-qrcode@"1.0.7" from the root project
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!

Sorry about this -- the an-qrcode demands an old version of Angular, so installing currently requires the flag:

--legacy-peer-deps

while installing ๐Ÿ˜ข

I'll try to fix this up somehow - at the very least with a comment in the README ๐Ÿ™‡

Thank you for raising this issue ๐Ÿค

Thanks for the very prompt response! ๐Ÿ˜„ ๐Ÿ‘๐Ÿผ

I tried this already, and I get 8 high vulnerabilities ๐Ÿ˜ž

 ~  npm install --legacy-peer-deps
npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm WARN deprecated asar@3.2.0: Please use @electron/asar moving forward.  There is no API change, just a package name change
npm WARN deprecated electron-osx-sign@0.6.0: Please use @electron/osx-sign moving forward. Be aware the API is slightly different

> video-hub-app-3@3.2.0 postinstall
> electron-builder install-app-deps

  โ€ข electron-builder  version=23.6.0
  โ€ข loaded configuration  file=D:\code\github\Video-Hub-App\electron-builder.json

added 1279 packages, and audited 1280 packages in 2m

190 packages are looking for funding
  run `npm fund` for details

11 vulnerabilities (3 moderate, 8 high)

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

I'll be running npm audit fix (as usual) before I create the next release ๐Ÿค

Thank you, and kudos for this amazing project! ๐Ÿ˜„ ๐Ÿ‘๐Ÿผ

ps - the repository that causes the error ๐Ÿ˜…
naimmalek/an-qrcode#7
I created a PR for it to fix the problem too ๐Ÿ˜Š
naimmalek/an-qrcode#11

I updated the README to make sure others don't run into this annoyance ๐Ÿ˜…

https://github.com/whyboris/Video-Hub-App/pull/781/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R45

Cheers!