Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 975
Marius Avatar asked May 07 '26 05:05

Marius


2 Answers

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.

like image 96
Hidayet Can Özcan Avatar answered May 10 '26 06:05

Hidayet Can Özcan


After digging for a while, I found a solution for this problem here which were posted not so long ago. This doesn't require overriding .npmrc which ignore some of the great features of pnpm.

pnpm and expo without node-linker=hoisted

like image 29
NaNomicon Avatar answered May 10 '26 06:05

NaNomicon