react-native-ping icon indicating copy to clipboard operation
react-native-ping copied to clipboard

Incompatible with react-native version 0.73.6

Open sepsol opened this issue 1 year ago • 7 comments

$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react-native
npm ERR!   react-native@"0.73.6" from the root project
npm ERR!   peer react-native@"*" from @gorhom/[email protected]
npm ERR!   node_modules/@gorhom/bottom-sheet
npm ERR!     @gorhom/bottom-sheet@"^4.6.1" from the root project
npm ERR!   40 more (@gorhom/portal, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react-native@"^0.41.2 || ^0.57.0 || ^0.68.0 || ^0.70.0" from [email protected]
npm ERR! node_modules/react-native-ping
npm ERR!   react-native-ping@"^1.2.8" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/react-native
npm ERR!   peer react-native@"^0.41.2 || ^0.57.0 || ^0.68.0 || ^0.70.0" from [email protected]
npm ERR!   node_modules/react-native-ping
npm ERR!     react-native-ping@"^1.2.8" 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! 
npm ERR! For a full report see:
npm ERR! /home/username/.npm/_logs/2024-03-25T20_10_19_693Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /home/username/.npm/_logs/2024-03-25T20_10_19_693Z-debug-0.log

sepsol avatar Mar 25 '24 20:03 sepsol

I'm using with "react-native": "0.73.7" @sepsol, and "react-native-ping": "^1.2.8".

marceloch2 avatar May 15 '24 19:05 marceloch2

@marceloch2 I just try to install it today but I got

npm ERR! Found: [email protected]
npm ERR! node_modules/react-native
npm ERR!   react-native@"0.73.6" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react-native@"^0.41.2 || ^0.57.0 || ^0.68.0 || ^0.70.0" from [email protected]

Did you install with --force or --legacy-peer-deps?

NhatAnh avatar Jul 11 '24 01:07 NhatAnh

@marceloch2 I just try to install it today but I got

npm ERR! Found: [email protected]
npm ERR! node_modules/react-native
npm ERR!   react-native@"0.73.6" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react-native@"^0.41.2 || ^0.57.0 || ^0.68.0 || ^0.70.0" from [email protected]

Did you install with --force or --legacy-peer-deps?

As it certainly do the job... Doesn't this mean this restrictions are not totally true? I mean. at 0.71.5 this module works just fine. The only thing I did was... Copying the index.d.ts onto my types one as this:

declare module 'react-native-ping' {
    type PingOptions = {
        /** Amount of time in ms to wait before reporting ping failed (Default: 1000ms) */
        timeout?: number;
        /** [iOS only] Size of the payload to send to the server (Default: 56 bytes) */
        payloadSize?: number;
      };
      
      type TrafficStats = {
        receivedNetworkSpeed: string;
        receivedNetworkTotal: string;
        sendNetworkSpeed: string;
        sendNetworkTotal: string;
      };
      
      export default class Ping {
        /**
         * Ping a specified server and return the RTT (Round-trip time) in ms
         * 
         * @param ipAddress IP Address of the server to ping (eg: 8.8.8.8)
         * @param options   Optional parameters
         */
        static start(
          ipAddress: string,
          options?: PingOptions,
        ): Promise<number>;
      
        static getTrafficStats(): Promise<TrafficStats>;
      }
}

So, then, if all the job is done... Why don't just increase the versions the module is available at? And, if it certainly works on typescript, why don't make it available to do so?

dasilvaca avatar Jul 12 '24 21:07 dasilvaca

--legacy-peer-deps

No --legacy-peer-deps or --force ish added my side. But I'm using yarn, can you try with it?

marceloch2 avatar Jul 15 '24 11:07 marceloch2

--legacy-peer-deps

No --legacy-peer-deps or --force ish added my side. But I'm using yarn, can you try with it?

I see the issue...

image

This seems to be the code available at npm. Different from the one at master which is:

(...)
"peerDependencies": {
    "react-native": ">=0.41.2"
  }

Then, this must be fixed as simple as merge package.json into the npm available one

dasilvaca avatar Jul 15 '24 17:07 dasilvaca

@RoJoHub can you please update the NPM package with new PRs

hasithaWalpola avatar Jul 31 '24 08:07 hasithaWalpola