Skip to content

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

Open
@toru-takahashi

Description

@toru-takahashi

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: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   peer react@"^16.8.1" from [email protected]
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 [email protected]
npm ERR! node_modules/react-native
npm ERR!   peer react-native@">=0.60.0-rc.0 <1.0.x" from [email protected]
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions