I have a Lerna project There are 2 react native projects inside the packages part.
GameCenter and Bingo
I want to use Bingo in Gamecenter
GameCenter metro.config
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
const path = require('path');
const config = {
watchFolders: [
// Lerna root düzeyindeki node_modules
path.resolve(__dirname, '../../node_modules'),
// Shared klasörü
path.resolve(__dirname, '../Bingo'),
],
resolver: {
extraNodeModules: {
react: path.resolve(__dirname, '../../node_modules/react'),
'react-native': path.resolve(__dirname, '../../node_modules/react-native'),
},
},
};
module.exports = mergeConfig(getDefaultConfig(__dirname), config);
Bingo metro.config
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
const path = require('path');
const config = {
watchFolders: [
// Lerna root düzeyindeki node_modules
path.resolve(__dirname, '../../node_modules'),
// Shared klasörü
path.resolve(__dirname, '../GameCenter'),
],
resolver: {
extraNodeModules: {
react: path.resolve(__dirname, '../../node_modules/react'),
'react-native': path.resolve(__dirname, '../../node_modules/react-native'),
},
},
};
module.exports = mergeConfig(getDefaultConfig(__dirname), config);
When I dont include the Bingo as dependince in GameCenter’s package.json
I can start the GameCenter with no error. But When I included Bingo as follows:
"dependencies": {
"react": "18.3.1",
"react-native": "0.76.5",
"Bingo": "*"
},
Gives following error
PS C:UsersFatihDesktopnewtest> yarn start:gamecenter
yarn run v1.22.22
$ cd packages/GameCenter && react-native run-android --port=8083
(node:30396) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
info Installing the app...
8 actionable tasks: 2 executed, 6 up-to-date
info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor
ERROR: autolinkLibrariesFromCommand: process cmd /c npx @react-native-community/cli config exited with error code: 1
FAILURE: Build failed with an exception.
* Where:
Settings file 'C:UsersFatihDesktopnewtestpackagesGameCenterandroidsettings.gradle' line: 3
* What went wrong:
A problem occurred evaluating settings 'android'.
> begin 0, end 1024, length 51
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BU�LD FAILED in 6s
error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8083
ERROR: autolinkLibrariesFromCommand: process cmd /c npx @react-native-community/cli config exited with error code: 1 FAILURE: Build failed with an exception. * Where: Settings file 'C:UsersFatihDesktopnewtestpackagesGameCenterandroidsettings.gradle' line: 3 * What went wrong: A problem occurred evaluating settings 'android'. > begin 0, end 1024, length 51 * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BU�LD FAILED in 6s.
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
How may I solve the problem
React native 0.76.5
node v20.18.0
“lerna”: “^8.1.9”