birdofpreyru / react-native-static-server

Embedded HTTP server for React Native
https://dr.pogodin.studio/docs/react-native-static-server
Other
135 stars 21 forks source link

To mant issue, unable to install #80

Closed 1-AlenToma closed 10 months ago

1-AlenToma commented 10 months ago

Hi, so I found this lib for which is support windows.

Bu I am not able to install it, I am getting to many error when I try to.

  "dependencies": {
    "react": "18.1.0",
    "react-native": "0.70.14",
    "react-native-windows": "0.70.21"
  },

Errors

npm i @dr.pogodin/react-native-static-server
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: ReactNativeEmulator@0.0.1
npm ERR! Found: react-native@0.70.14
npm ERR! node_modules/react-native
npm ERR!   react-native@"0.70.14" from the root project
npm ERR!   peer react-native@"*" from @dr.pogodin/react-native-static-server@0.9.0
npm ERR!   node_modules/@dr.pogodin/react-native-static-server
npm ERR!     @dr.pogodin/react-native-static-server@"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native@"^0.72" from @dr.pogodin/react-native-fs@2.21.0-alpha.8
npm ERR! node_modules/@dr.pogodin/react-native-fs
npm ERR!   peer @dr.pogodin/react-native-fs@">=2.21.0-alpha.1" from @dr.pogodin/react-native-static-server@0.9.0
npm ERR!   node_modules/@dr.pogodin/react-native-static-server
npm ERR!     @dr.pogodin/react-native-static-server@"*" 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 C:\Users\alent\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C

Any help solving thia?

1-AlenToma commented 10 months ago

Ok found the issue here.

[react-native-fs] have those packages which I am not able to have now.

Is there a specific reason for this ?

 "peerDependencies": {
    "react": "*",
    "react-native": "^0.72",
    "react-native-windows": "^0.72"
  },
birdofpreyru commented 10 months ago

Hi @1-AlenToma ,

Check this out — somebody tried to use my fork of react-native-fs with RN 0.70 on Windows, and it did not work for him; although that worked for him with RN 0.72:

After that I declared required RN peer dependency as v0.72.

birdofpreyru commented 10 months ago

Perhaps, try to use v0.7.13 of react-native-static-server — it does not rely on my fork of react-native-fs, but on the old original react-native-fs, though that one does not work out of the box for Windows, so it requires to separately grab and add to the project a few files (you may check how it was done in the example app — https://github.com/birdofpreyru/react-native-static-server/tree/d88ba3b2571434c76c3c39aedc0a292375fda034/example/windows/ReactNativeStaticServerExample — pay attention to RNFSManager.cpp and RNFSManager.h files).