pnpm: Not working with CRNA
I tried it in the previous release too & also in this release but the only reason I can’t use PNPM is because it doesn’t work using CRNA.
Now its giving error - Cannot find module 'babel-plugin-transform-flow-strip-types'
Steps to repro -
create-react-native-app myApp
rm -rf node_modules && rm yarn.lock
pnpm i
pnpm start
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 23 (20 by maintainers)
So I got
react-nativeworking with pnpm. https://github.com/pnpm/pnpm/issues/1051#issuecomment-372753512I will take a look at getting it working for CRNA soon.
@deadcoder0904
--shamefully-flattenwould help with the missing deps, yes, but this is easy and safer to fix in thepnpmfile.But the main challenge was patching
metro. And patching it in multiple versions because Expo uses an older version ofreact-native.Updated pnpmfile.js that works for me.
I still couldn’t get it to work. There are some more issues related to react-native not supporting symlinks. See https://github.com/facebook/react-native/issues/18156
Here is a more automated way to work with CRNA.
I will be removing the
babel-registerdependency tomorrow.pnpmfile.js
pnpmfile/package.json
pnpmfile/index.js
package.json
You must run the following to ensure that
pnpmfiledeps are installed first.Got CRNA working with
pnpmfile.js. Was a bit tricky becauseexpohides errors from the react-native packager and it uses an older version ofreact-nativewhich I had to create a custom patch of metro.Will tidy this up later.
@deadcoder0904 I just checked. It is an issue with
metro-bundler. It uses a bunch of packages that are not declared in itspackage.json. They should fix it.With a pnpm hook, I added the missing dependencies to its manifest and it worked.
pnpmfile.js:Part 1 - Getting expo-cli working with pnpm: https://github.com/expo/expo-cli/issues/183
Will track progress here: https://github.com/pnpm/pnpm/issues/1501