Open sepsol opened 8 months ago
I'm using with "react-native": "0.73.7" @sepsol, and "react-native-ping": "^1.2.8".
@marceloch2 I just try to install it today but I got
npm ERR! Found: react-native@0.73.6
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 react-native-ping@1.2.8
Did you install with --force or --legacy-peer-deps?
@marceloch2 I just try to install it today but I got
npm ERR! Found: react-native@0.73.6 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 react-native-ping@1.2.8
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?
--legacy-peer-deps
No --legacy-peer-deps or --force ish added my side. But I'm using yarn, can you try with it?
--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...
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
@RoJoHub can you please update the NPM package with new PRs
Hey, i've made a new ping package if anyone interested about replacing this library with a new one, but currently only for Android. Feel free to use react-native-ping-android