Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation requires --legacy-peer-deps from npm v7 or later #30

Open
toru-takahashi opened this issue Feb 28, 2022 · 0 comments
Open

Comments

@toru-takahashi
Copy link

README describes % npm install td-react-native-sdk --save for installation. However, it doesn't work.

 % npm install td-react-native-sdk --save
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@0.0.0
npm ERR! Found: react@16.14.0
npm ERR! node_modules/react
npm ERR!   peer react@"^16.8.1" from td-react-native-sdk@0.2.0
npm ERR!   node_modules/td-react-native-sdk
npm ERR!     td-react-native-sdk@"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.2" from react-native@0.67.3
npm ERR! node_modules/react-native
npm ERR!   peer react-native@">=0.60.0-rc.0 <1.0.x" from td-react-native-sdk@0.2.0
npm ERR!   node_modules/td-react-native-sdk
npm ERR!     td-react-native-sdk@"*" 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/torutakahashi/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/torutakahashi/.npm/_logs/2022-02-28T01_41_23_498Z-debug-0.log

However, adding --legacy-peer-deps works.

 % npm install td-react-native-sdk  --legacy-peer-deps --save
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile

added 12 packages, removed 25 packages, changed 11 packages, and audited 319 packages in 3s

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

20 vulnerabilities (15 moderate, 5 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

This is because npm v7 or later changed the behavior. We may need to fix some installation ways or update README.

Ref. https://stackoverflow.com/questions/66239691/what-does-npm-install-legacy-peer-deps-do-exactly-when-is-it-recommended-wh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant