「json-schema-rules」ライブラリを使用しているreact-nativeアプリが1つあります。これで、package.json の「file:../custom_library」のように、反応ネイティブ アプリで使用される 1 つのライブラリも作成されました。
バージョンの競合を解決するために、カスタム ライブラリのピア依存関係として "json-schema-rules" を使用することにしました。したがって、package.json は次のようになります。
反応ネイティブ アプリの Package.json:
{
"dependencies": {
"json-rules-engine": "^2.3.0",
"custom_library": "file:../custom_library"
}
}
私のcustom_libraryのpackage.json:{
"peerDependencies": {
"json-schema-rules": "^2.3.0"
}
}
問題は、metro bundler を使用しているときにエラー エラーが発生することです。bundling failed: Error: Unable to resolve module json-rules-engine
json-rules-engine could not be found in the project.
これは、peerDependencies で使用している場合です。このライブラリを依存関係で使用しても、エラーは発生しません。
助けてください。