ignite icon indicating copy to clipboard operation
ignite copied to clipboard

`Error: Cannot find module 'metro-cache'` when initiating the new ignite project

Open naoyamakino opened this issue 2 months ago โ€ข 6 comments

Describe the bug

Thank you Infinite Red for this amazing work ๐Ÿ’ฏ

Here are steps I took to get started.

 npx ignite-cli@latest new PizzaApp --yes





                                               .;;,.    .clll.
                                              .clll,    ,llll.           ...
                                               .,;,.    ;lllc'.,.   .';cllllc,
     .',,.                           ...      .'',,. .:lllllllll. .;lllc:;clll,
    .llll,                    .,...;cllll:.   ,llll, .llllllc,,'  clll:'.,cllc.
    ,llll'       ......;::.  'llcclllllllll'  ,llll,   .llll.    ,lllllllll:'
    ,llll.    .;clllllclll.  'llllc,..,llll,  :llll.   'llll.    ,lllc,''..
    ;llll.   :llllc:cllllc.  ,llll.   .llll, .lllll.   ,lllc...  ,lll:...';:.
   .llllc.  ;lll;.   :lll,   ;lll;    'llll, .llllc.   ,llllcll' .:lllllllll,
   .llll,  'lll:    .clll,   :lll,    ,llll. 'llll,    'lllllcc'   ';::::;'.
   .llll,  ,lll:    .llll'  .llll,    ;llll. ,llll,     .....             .',..
   ,llll.  'llll:,,:cllll.  .lllc.    .''..  ... ....',;         ..',,:::;'..
   ,llll.   'clllllllllll.     .....        ..,::cllllc.   .',:clllc;,'.
   :llll.     ',;,'.;lllc...,;:clll;  ..',:cllllllllll:,;clllllc;,'.
   llll:        ...'cllllllllllllll::cllllllc;,',cllllllllc;'..
   llll,   ..,clllllllll::,,.,lllllllc:,'...    :lllllc,..
   c:;,.  .cllllc:;:llll.    ,ll:;,..          ;ll:,..
          :lll,.  .clll,     ..               .,..
          :lll:,,cllll,
          .cllllllllc'
           .'cllll:.



    โ–ˆ Creating PizzaApp using Ignite 9.6.3
    โ–ˆ Powered by  โˆž Infinite Red  (https://infinite.red)
    โ–ˆ Package Manager: yarn
    โ–ˆ Bundle identifier: com.pizzaapp
    โ–ˆ Path: /Users/naoyamakino/git/PizzaApp
    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

    ๐Ÿ–จ  3D-printing a new React Native app
    ๐ŸŽจ Getting those last few details perfect
    ๐Ÿงถ Installing yarn dependencies (wow these are heavy)
       Configuring app.json
    ๐Ÿ› ๏ธ  Removing fancy demo markup
    ๐Ÿ—„  Backing everything up in source control

    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

    Ignited PizzaApp in 15.71s  ๐Ÿš€

    For next time: here are the Ignite options you picked!
      npx ignite-cli new PizzaApp \
        --bundle=com.pizzaapp \
        --git \
        --install-deps \
        --overwrite=false \
        --packager=yarn \
        --target-path=/Users/naoyamakino/git/PizzaApp \
        --remove-demo=false \
        --workflow=expo \
        --no-timeout=false

    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

    Need additional help?

    Join our Slack community at http://community.infinite.red.

    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

    Now get cooking! ๐Ÿฝ
      cd /Users/naoyamakino/git/PizzaApp
      yarn ios
    Or Android via
      yarn android

succeed ๐Ÿ‘ then

 cd PizzaApp; yarn ios
Starting project at /Users/naoyamakino/git/PizzaApp
Error: expo-localization tried to access @expo/config-plugins, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: @expo/config-plugins (via "@expo/config-plugins/build/android/Manifest")
Required by: expo-localization@virtual:c8e0c5b5ac0440e31d4ad667e0f0b6e78a7ec8d74de0e3d7282ee58a08367049ebf8e525d7001fa51e13a238833e05080cbd82d36e7fb653a26dddb1e1d9de7f#npm:14.8.4 (via /Users/naoyamakino/git/PizzaApp/.yarn/__virtual__/expo-localization-virtual-95d36c78a2/3/.yarn/berry/cache/expo-localization-npm-14.8.4-7f4d6b02fc-10c0.zip/node_modules/expo-localization/plugin/build/)

Require stack:
- /Users/naoyamakino/git/PizzaApp/.yarn/__virtual__/expo-localization-virtual-95d36c78a2/3/.yarn/berry/cache/expo-localization-npm-14.8.4-7f4d6b02fc-10c0.zip/node_modules/expo-localization/plugin/build/withExpoLocalization.js
- /Users/naoyamakino/git/PizzaApp/.yarn/__virtual__/expo-localization-virtual-95d36c78a2/3/.yarn/berry/cache/expo-localization-npm-14.8.4-7f4d6b02fc-10c0.zip/node_modules/expo-localization/app.plugin.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/config-plugins/build/utils/plugin-resolver.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/config-plugins/build/plugins/withStaticPlugin.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/config-plugins/build/plugins/withPlugins.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/config-plugins/build/index.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/config/build/plugins/withConfigPlugins.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/config/build/Config.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/config/build/index.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/utils/analytics/getDevClientProperties.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/resolveOptions.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/index.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/bin/cli
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/expo/bin/cli
Error: expo-localization tried to access @expo/config-plugins, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: @expo/config-plugins (via "@expo/config-plugins/build/android/Manifest")
Required by: expo-localization@virtual:c8e0c5b5ac0440e31d4ad667e0f0b6e78a7ec8d74de0e3d7282ee58a08367049ebf8e525d7001fa51e13a238833e05080cbd82d36e7fb653a26dddb1e1d9de7f#npm:14.8.4 (via /Users/naoyamakino/git/PizzaApp/.yarn/__virtual__/expo-localization-virtual-95d36c78a2/3/.yarn/berry/cache/expo-localization-npm-14.8.4-7f4d6b02fc-10c0.zip/node_modules/expo-localization/plugin/build/)

Require stack:
- /Users/naoyamakino/git/PizzaApp/.yarn/__virtual__/expo-localization-virtual-95d36c78a2/3/.yarn/berry/cache/expo-localization-npm-14.8.4-7f4d6b02fc-10c0.zip/node_modules/expo-localization/plugin/build/withExpoLocalization.js
- /Users/naoyamakino/git/PizzaApp/.yarn/__virtual__/expo-localization-virtual-95d36c78a2/3/.yarn/berry/cache/expo-localization-npm-14.8.4-7f4d6b02fc-10c0.zip/node_modules/expo-localization/app.plugin.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/config-plugins/build/utils/plugin-resolver.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/config-plugins/build/plugins/withStaticPlugin.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/config-plugins/build/plugins/withPlugins.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/config-plugins/build/index.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/config/build/plugins/withConfigPlugins.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/config/build/Config.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/config/build/index.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/utils/analytics/getDevClientProperties.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/resolveOptions.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/index.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/bin/cli
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/expo/bin/cli
    at Function.require$$0.Module._resolveFilename (/Users/naoyamakino/git/PizzaApp/.pnp.cjs:24517:13)
    at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/Users/naoyamakino/.yarn/berry/cache/@cspotcode-source-map-support-npm-0.8.1-964f2de99d-10c0.zip/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
    at Function.Module._load (node:internal/modules/cjs/loader:985:27)
    at Function.require$$0.Module._load (/Users/naoyamakino/git/PizzaApp/.pnp.cjs:24408:31)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (/Users/naoyamakino/git/PizzaApp/.yarn/__virtual__/expo-localization-virtual-95d36c78a2/3/.yarn/berry/cache/expo-localization-npm-14.8.4-7f4d6b02fc-10c0.zip/node_modules/expo-localization/plugin/build/withExpoLocalization.js:3:20)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at require$$0.Module._extensions..js (/Users/naoyamakino/git/PizzaApp/.pnp.cjs:24560:33)

I added the following change in the package.json

diff --git a/package.json b/package.json
index 8071ba9..0773d41 100644
--- a/package.json
+++ b/package.json
@@ -31,6 +31,7 @@
   },
   "dependencies": {
     "@expo-google-fonts/space-grotesk": "^0.2.2",
+    "@expo/config-plugins": "^6.0.0",
     "@expo/metro-runtime": "~3.1.3",
     "@react-native-async-storage/async-storage": "1.21.0",
     "@react-navigation/bottom-tabs": "^6.3.2",
@@ -48,6 +49,7 @@

with that, when I run yarn ios

 yarn ios
Starting project at /Users/naoyamakino/git/PizzaApp
Error: Cannot find module 'metro-cache'
Require stack:
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/metro-config/build/ExpoMetroConfig.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/serverLogLikeMetro.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/getStaticRenderFunctions.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/metro/metroErrorInterface.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/metro/bundleApiRoutes.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/metro/MetroBundlerDevServer.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/DevServerManager.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/startAsync.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/index.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/bin/cli
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/expo/bin/cli
Require stack:
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/metro-config/build/ExpoMetroConfig.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/serverLogLikeMetro.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/getStaticRenderFunctions.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/metro/metroErrorInterface.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/metro/bundleApiRoutes.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/metro/MetroBundlerDevServer.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/DevServerManager.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/startAsync.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/index.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/bin/cli
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/expo/bin/cli
Error: Cannot find module 'metro-cache'
Require stack:
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/metro-config/build/ExpoMetroConfig.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/serverLogLikeMetro.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/getStaticRenderFunctions.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/metro/metroErrorInterface.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/metro/bundleApiRoutes.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/metro/MetroBundlerDevServer.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/DevServerManager.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/startAsync.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/index.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/bin/cli
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/expo/bin/cli
Require stack:
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/metro-config/build/ExpoMetroConfig.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/serverLogLikeMetro.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/getStaticRenderFunctions.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/metro/metroErrorInterface.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/metro/bundleApiRoutes.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/metro/MetroBundlerDevServer.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/server/DevServerManager.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/startAsync.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/src/start/index.js
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/cli/build/bin/cli
- /Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/expo/bin/cli
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Function.require$$0.Module._resolveFilename (/Users/naoyamakino/git/PizzaApp/.pnp.cjs:24556:54)
    at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/Users/naoyamakino/.yarn/berry/cache/@cspotcode-source-map-support-npm-0.8.1-964f2de99d-10c0.zip/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
    at Function.Module._load (node:internal/modules/cjs/loader:985:27)
    at Function.require$$0.Module._load (/Users/naoyamakino/git/PizzaApp/.pnp.cjs:24470:31)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (/Users/naoyamakino/.npm/_npx/249ca9fcd30c476a/node_modules/@expo/metro-config/src/ExpoMetroConfig.ts:8:1)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)

then I've installed metro-cache the following

โœ— yarn add metro-cache
โžค YN0000: ยท Yarn 4.1.1
โžค YN0000: โ”Œ Resolution step
โžค YN0000: โ”” Completed in 0s 219ms
โžค YN0000: โ”Œ Post-resolution validation
โžค YN0002: โ”‚ pizza-app@workspace:. doesn't provide @types/node (p500be), requested by ts-node.
โžค YN0086: โ”‚ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
โžค YN0000: โ”” Completed
โžค YN0000: โ”Œ Fetch step
โžค YN0000: โ”” Completed in 0s 947ms
โžค YN0000: โ”Œ Link step
โžค YN0000: โ”‚ ESM support for PnP uses the experimental loader API and is therefore experimental
โžค YN0008: โ”‚ pizza-app@workspace:. must be rebuilt because its dependency tree changed
โžค YN0000: โ”” Completed in 1s 120ms
โžค YN0000: ยท Done with warnings in 2s 448ms

but it still gives me Error: Cannot find module 'metro-cache' error.

currently my package.json is

diff --git a/package.json b/package.json
index 8071ba9..0773d41 100644
--- a/package.json
+++ b/package.json
@@ -31,6 +31,7 @@
   },
   "dependencies": {
     "@expo-google-fonts/space-grotesk": "^0.2.2",
+    "@expo/config-plugins": "^6.0.0",
     "@expo/metro-runtime": "~3.1.3",
     "@react-native-async-storage/async-storage": "1.21.0",
     "@react-navigation/bottom-tabs": "^6.3.2",
@@ -48,6 +49,7 @@
     "expo-splash-screen": "~0.26.3",
     "expo-status-bar": "~1.11.1",
     "i18n-js": "3.9.2",
+    "metro-cache": "^0.80.8",
     "mobx": "6.10.2",
     "mobx-react-lite": "4.0.5",
     "mobx-state-tree": "5.3.0",

am I missing anything? thank you โค๏ธ

Ignite version

9.6.3

Additional info

 npx ignite-cli doctor
System
  platform           darwin
  arch               x64
  cpu                8 cores      Apple M2
  directory          PizzaApp     /Users/naoyamakino/git/PizzaApp

/Users/naoyamakino/.npm/_npx/e31027f3785124a8/node_modules/gluegun/build/index.js:15
    throw up;
    ^
Usage Error: The 'yarn global' commands have been removed in 2.x - consider using 'yarn dlx' or a third-party plugin instead

$ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] [--require #0] <scriptName> ...

(Use `node --trace-uncaught ...` to show where the exception was thrown)

Node.js v20.11.1

naoyamakino avatar Apr 22 '24 07:04 naoyamakino

@frankcalise I was able to replicate the issue above with the following steps:

  1. Use yarn 1.22.22 to Ignite a new project
  2. @naoyamakino is using yarn 4.1.1 so let's move to that yarn set version stable
  3. yarn install && yarn ios
  4. ๐Ÿ™Œ the application builds without issue.
  5. rm -rf node_modules and edit the .yarnrc.yml file to remove the line nodeLinker: node-modules
  6. yarn install && yarn ios
  7. ๐Ÿ’ฅ the error that @naoyamakino is seeing above

The reason this works for switching to yarn 4.1.1 after the application is Ignited the first time is that yarn 4.1.1 will migrate the repo on first yarn install after setting the new yarn version:

โžค YN0087: Migrated your project to the latest Yarn version ๐Ÿš€

This adds the missing piece to our .yarnrc.yml file: nodeLinker: node-modules.

I thought we were detecting the yarn version and adding this into the .yarnrc.yml file, but I can't find a reference to that in the repo.

@naoyamakino adding nodeLinker: node-modules to your .yarnrc.yml will get things working for you. Otherwise, yarn goes into PnP mode, which I've yet to see work on any project ๐Ÿ˜…. You may also see the following folders and directories from PnP that you can get rid of:

.pnp.cjs
.pnp.loader.mjs
.yarn/unplugged

@naoyamakino thanks for reporting the issue ๐Ÿ™Œ

morganick avatar Apr 22 '24 14:04 morganick

@morganick probably related: https://github.com/expo/expo-cli/issues/1073#issuecomment-1871186522

frankcalise avatar Apr 22 '24 14:04 frankcalise

Thanks! I believe that worked! I am having a separate issue, which seems to be related to https://github.com/expo/expo/issues/28345, but that is at least different from what I faced in this issue. thank you for resolving this!

naoyamakino avatar Apr 23 '24 13:04 naoyamakino

You're welcome @naoyamakino ๐Ÿ™Œ Happy coding!

@frankcalise shall we close this as an expo issue or did we want to do yarn version detection?

morganick avatar Apr 23 '24 13:04 morganick

You're welcome @naoyamakino ๐Ÿ™Œ Happy coding!

@frankcalise shall we close this as an expo issue or did we want to do yarn version detection?

@morganick So if we wanted to enhance the cli to work with yarn 2+, what would that look like?

Something like this we did for pnpm depending on the yarn version? https://github.com/infinitered/ignite/blob/master/src/commands/new.ts#L615-L621

frankcalise avatar Apr 23 '24 14:04 frankcalise

@frankcalise Yes! That's the one I was thinking about! Yeah, we could do something similar for Yarn 2+.

morganick avatar Apr 23 '24 15:04 morganick