should NOT have additional property 'nodeModulesPath'(Expo React Native)

Viewed 11664

How can I resolve this issue. I am getting this error after I upgraded my expo application on my phone:

Error: Problem validating fields in app.json. See https://docs.expo.io/workflow/configuration/ • should NOT have additional property 'nodeModulesPath'.

7 Answers

Yes, I faced the same issue. So I upgraded the expo-cli using npm install -g expo-cli My expo-cli version is 4.4.4 and I can't see the error anymore. Thank you, Sardorek Aminjonov

@Sardorek, ran into the same problem, spent more than an hour, and finally figured it out.

The solution is to add the Expo SDK version in the app.json file. My version is 40.0.1. You can see it in package.json.

"react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz"

Upgrading to version 40 has removed it from the app.json file.

Now, add the major.minor.0 version in the app.json file like:

"sdkVersion": "40.0.0"

Looks like you cannot include the maintenance version number. If you do, you will get this error.

Error: Invalid sdkVersion. Valid options are 7.0.0, 8.0.0, 9.0.0, 10.0.0, 11.0.0, 12.0.0, 13.0.0, 14.0.0, 15.0.0, 16.0.0, 17.0.0, 18.0.0, 19.0.0, 20.0.0, 21.0.0, 22.0.0, 23.0.0, 24.0.0, 25.0.0, 26.0.0, 27.0.0, 28.0.0, 29.0.0, 30.0.0, 31.0.0, 32.0.0, 33.0.0, 34.0.0, 35.0.0, 36.0.0, 37.0.0, 38.0.0, 39.0.0, 40.0.0, 41.0.0
Couldn't publish because errors were found. (See logs above.) Please fix the errors and try again.

Now, run expo start, and voila it works! Hope this helps.

I landed on the same issue on a different context.
I am releasing my app with expo-github-action.

My problem was during the build expo publish --clear --release-channel staging

[08:52:02] - Expo SDK: 41.0.0
[08:52:02] - Release channel: staging
[08:52:02] - Workflow: Managed

[08:52:03] Building optimized bundles and generating sourcemaps...
[08:52:03] Error: Problem validating fields in app.json. See https://docs.expo.io/workflow/configuration/
[08:52:03]  • should NOT have additional property 'nodeModulesPath'.

Solved with updating node-version

// .github/workflows/staging.yml
...
 steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: 14.x      <------- update here
      - uses: expo/expo-github-action@v5
        with:
          expo-version: 4.x      <------- update here
          expo-username: ${{ secrets.EXPO_CLI_USERNAME }}
          expo-password: ${{ secrets.EXPO_CLI_PASSWORD }}
          expo-cache: true

For Expo SDK42 is not needed to add "sdkVersion": "42.0.0", it's deprecated and will not work.

The solution is to update expo-cli to version 4.9.0 - npm i expo-cli@4.9.0

NOTE: be careful because with v4.9.1 it still appears :/

Error? its an expo related breakage

solution? simply go to your app.json file, add an expo property like so

{

  "expo":{
     "appKey":"NodeModulesPath",
  },
  
  "name": "NodeModulesPath",
}

ps: you can replace the "nodeModulesPath" with your particular property that is throwing the error

I had that problem so I updated the expo go (the app to run the application) and it fixed

Related