Search code examples
react-nativeexpo

React Native Expo with Pnpm?


I'm trying to get React Native Expo running with Pnpm, but getting this issue enter image description here

With Npm or Yarn no issues.


Solution

  • That was bugging me too for couple a days, you have to create a .npmrc file and add this line;

    node-linker=hoisted

    And if you are asking why? Here is your answer;

    By default, pnpm manages dependencies using hard links and does not flatten the dependency structure. This is incompatible with expo project structure.

    Using the node-linker=hoisted setting in the .npmrc file tells pnpm to manage dependencies in a more traditional structure, similar to how other tools like npm or yarn do it.