ssbc / react-native-ssb-shims

Node.js-related shims necessary for the SSB ecosystem to run on React Native apps
MIT License
7 stars 3 forks source link

Installation fails with errors #3

Closed luandro closed 5 years ago

luandro commented 6 years ago

Worth mentioning that patch-package needs npm(>=5) or yarn for it to work correctly. But this occurs even using npm 5.6.0.

  1. Problem with react-native-os:

    Scanning folders for symlinks in project/node_modules (20ms)
    { Error: Cannot find module 'project/node_modules/react-native-os/package.json'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at getRNPMConfig (project/node_modules/react-native/local-cli/core/index.js:55:3)
    at Object.getDependencyConfig (project/node_modules/react-native/local-cli/core/index.js:117:18)
    at deps.reduce.err (project/node_modules/react-native/local-cli/link/getDependencyConfig.js:9:24)
    at Array.reduce (native)
    at getDependencyConfig (project/node_modules/react-native/local-cli/link/getDependencyConfig.js:6:15)
    at Object.link (project/node_modules/react-native/local-cli/link/link.js:133:24) code: 'MODULE_NOT_FOUND' }
  2. patch-package is not found:

sh: patch-package: command not found

Tried fixing (2) by installing patch-package separately. It lets the module be installed, by when running the project I get an error that seems related to react-native-fs:

project/node_modules/react-native-fs/android/src/main/java/com/rnfs/RNFSPackage.java:20: error: method does not override or implement a method from a supertype
  @Override
  ^
Note: project/node_modules/react-native-fs/android/src/main/java/com/rnfs/RNFSManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
:react-native-fs:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-fs:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

Have tried installing react-native-fs separately but that just messes everything up, like reported in this issue.

staltz commented 6 years ago

Hey Luandro, thanks. To be honest, everywhere I use patch-package, I should replace it with a fork of the package, or a proper PR. I'll remember to do this but if you're in a hurry you can try making forks too

luandro commented 6 years ago

Hey @staltz,

Began trying to replace the patches for forks using @luandro/react-native-ssb-shims to publish the tests so far.

With just a little tweaking I was able to build mmmmm, which is a good starting point to understand how everything comes together, and how. Although MMMMM I built doesn't find peers in my local network. Maybe conflicting something with apk version I had installed before?

staltz commented 6 years ago

Hey @luandro that's good news! React-native-fs could be a newer version, we just need to check if it's API had new breaking changes.

And about multiserver, we shouldn't fork it, the patch was just an ugly hack. We should fork react-native-tcp which should support an API that is compatible with the official tcp. The reason why I changed multiserver was to make it's usage of tcp API match the (wrong) tcp API in react-native-tcp

luandro commented 6 years ago

Ok, sorry I'm still not familiar with ssb inner workings just yet, but I'll try to investigate thru MMMMM code and see if I can help with the appropriate forks. Cheers!

staltz commented 6 years ago

I could also do it, but it would be great to have some help. Keep on asking if you need any help!

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.