-
Notifications
You must be signed in to change notification settings - Fork 902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pod install & react-native info fail with @react-native-community/cli-config 8.0.3 and ramda 0.28.0 installed #1650
Comments
You need to change node_modules/ramda/package.json file export section like
|
@jaiminbhut I know that change fixes it, but I wasn't sure if I should open a issue / PR in |
I'm not sure, but I think that there is a problem with the
|
Yeah, I guess it's this commit that changed it from an warning to an error: 57b825b |
same issues is with d3-array package : Invalid `Podfile` file: 859: unexpected token at 'Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json' is not defined by "exports" in XXX/node_modules/d3-array/package.json |
same issue with
|
Temporary solution:
diff --git a/node_modules/@react-native-community/cli-config/build/loadConfig.js b/node_modules/@react-native-community/cli-config/build/loadConfig.js
index fcf5068..8942788 100644
--- a/node_modules/@react-native-community/cli-config/build/loadConfig.js
+++ b/node_modules/@react-native-community/cli-config/build/loadConfig.js
@@ -90,8 +90,19 @@ function loadConfig(projectRoot = (0, _cliTools().findProjectRoot)()) {
};
const finalConfig = Array.from(new Set([...Object.keys(userConfig.dependencies), ...(0, _findDependencies.default)(projectRoot)])).reduce((acc, dependencyName) => {
const localDependencyRoot = userConfig.dependencies[dependencyName] && userConfig.dependencies[dependencyName].root;
- let root = localDependencyRoot || (0, _cliTools().resolveNodeModuleDir)(projectRoot, dependencyName);
- let config = (0, _readConfigFromDisk.readDependencyConfigFromDisk)(root, dependencyName);
+ let root;
+ let config;
+ try {
+ root = localDependencyRoot || (0, _cliTools().resolveNodeModuleDir)(projectRoot, dependencyName);
+ config = (0, _readConfigFromDisk.readDependencyConfigFromDisk)(root, dependencyName);
+ } catch (error) {
+ _cliTools().logger.warn((0, _cliTools().inlineString)(`
+ Package ${dependencyName} has been ignored because it contains invalid configuration.
+
+ Reason: ${error.message}`));
+
+ return acc;
+ }
const isPlatform = Object.keys(config.platforms).length > 0;
return (0, _assign.default)({}, acc, {
dependencies: (0, _assign.default)({}, acc.dependencies, { |
fixed with version |
Environment
If I remove
ramda
:Description
pod install
throws an error with"@react-native-community/cli-config": "8.0.3"
and"ramda": "0.28.0"
installed. I am not sure if this is something that should be fixed inramda
(is it required to add"./package.json"
to"exports"
inpackage.json
for all npm packages that useexports
?) or in this project. The error does not happen with"@react-native-community/cli-config": "8.0.2"
.The error for
npx react-native info
can be seen above, at the beginning of this description.The error for
pod install
:Reproducible Demo
New React Native 0.69.1 project with ramda 0.28.0 installed: https://github.com/mlazari/PackageJsonErrorRepro/tree/main
To reproduce run
yarn install && cd ios && pod install
, or evennpx react-native info
.If I force
"@react-native-community/cli-config": "8.0.2"
via yarn "resolutions", thenpod install
runs fine andnpx react-native info
just shows a warning for ramda (warn Package ramda has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /Users/mihai/Desktop/Repos/PackageJsonErrorRepro/node_modules/ramda/package.json
): https://github.com/mlazari/PackageJsonErrorRepro/tree/cli-config-8.0.2For project using npm rather than yarn, the version can be forced to
8.0.2
via the "overrides" option:But there is a known issue with that: npm/cli#4232
The text was updated successfully, but these errors were encountered: