Thomas Geiger
Thomas Geiger

Reputation: 1

I'm getting errors when trying to import and use ngx-qrcode2 in my angular 14 app to create qr codes. Is there a better lib?

Getting an error when running npm install

npm install ngx-qrcode2 --save

npm install ngx-qrcode2 --save npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! node_modules/tslib npm ERR! tslib@"^2.3.0" from the root project npm ERR! tslib@"^2.3.0" from @angular/[email protected] npm ERR! node_modules/@angular/common npm ERR! @angular/common@"^14.1.0" from the root project npm ERR! peer @angular/common@">=6.0.0 || <=10.0.0" from [email protected] npm ERR! node_modules/ngx-qrcode2 npm ERR! ngx-qrcode2@"" from the root project npm ERR! 3 more (@angular/core, rxjs, zone.js) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer tslib@"^1.10.0" from [email protected] npm ERR! node_modules/ngx-qrcode2 npm ERR! ngx-qrcode2@"" 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! npm ERR! See /Users/geigersoft/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/geigersoft/.npm/_logs/2023-09-22T04_37_25_751Z-debug-0.log

Upvotes: 0

Views: 204

Answers (1)

saqib sattar
saqib sattar

Reputation: 55

you can try to clean the cache using this command: npm cache clean --force, then delete the node_module directory and also delete package-lock.json and then try to reinstall the package. i hope this will work.

Upvotes: 0

Related Questions