Giter Site home page Giter Site logo

Comments (5)

marceloch2 avatar marceloch2 commented on July 30, 2024

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

from react-native-ping.

NhatAnh avatar NhatAnh commented on July 30, 2024

@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?

from react-native-ping.

dasilvaca avatar dasilvaca commented on July 30, 2024

@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?

from react-native-ping.

marceloch2 avatar marceloch2 commented on July 30, 2024

--legacy-peer-deps

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

from react-native-ping.

dasilvaca avatar dasilvaca commented on July 30, 2024

--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

from react-native-ping.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.