On the nightly, @react-native-community/cli 20 finds no platforms or commands, with no warning that it needs CLI 21
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 1/5
- Tempo estimado
- Menos de uma hora
- Facilidade para iniciantes
- 88/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- javascript, node.js, react-native
- Domínio
- developer-experience
Direção de pesquisa
Comece em packages/community-cli-plugin/package.json, especificamente na entrada peerDependencies para @react-native-community/cli, que a issue vincula nas linhas 46-49. Altere esse intervalo para indicar CLI 21 ou mais recente, as versões que conseguem ler a configuração movida em #58670 e #58671. Verifique o resultado com o reproducer vinculado: com CLI 20.2.0 instalado, yarn install agora deve emitir um aviso, enquanto CLI 21.0.0-alpha.1 ainda deve satisfazer o intervalo de peer. Pronto significa que o intervalo de peer reflete as versões de CLI compatíveis sem alterar o código de runtime do plugin.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Description
On 0.89.0-nightly-20261030-4afc5d5b9, an app that still has @react-native-community/cli 20.2.0, the version the reproducer template and every 0.88 app ship, gets no platforms and no commands from the CLI, and nothing says why: yarn android fails with error: unknown command 'run-android', npx react-native config prints "platforms": {} and "project": {}, and Gradle's :app:generateAutolinkingPackageList fails with Could not find project.android.packageName in react-native config output!. With @react-native-community/cli 21.0.0-alpha.1, the same app's config has the Android and iOS platforms and packageName: com.reproducerapp.
The platform config moved out of react-native in b26baaeba026f34963656a8daec7f5f494253160 (#58670) and be9fbdd0d59ffd88992f16523b5fbfe9db709e6a (#58671), so CLI 20 no longer finds it. @react-native/community-cli-plugin still declares "@react-native-community/cli": "*" as its peer (package.json), so the install accepts CLI 20 without a warning. I'd expect the peer range to name the CLI versions that can read the new config, so the install points at the fix.
Steps to reproduce
- Clone https://github.com/YevheniiKotyrlo/rn-nightly-cli-20-no-platforms. It is the reproducer template with
react-nativeand every@react-native/*package moved to0.89.0-nightly-20261030-4afc5d5b9, and@react-native-community/clileft at 20.2.0. - In
ReproducerApp, runyarn install. It finishes with no warning about@react-native-community/cli. - Run
yarn android. Expected: the app builds. Actual:error: unknown command 'run-android'. - Run
npx react-native config. Expected: the Android and iOS platforms and the Android project. Actual:"commands": [],"platforms": {}and"project": {}, exit 0. - In
ReproducerApp/android, run./gradlew :app:generateAutolinkingPackageList. Expected: the package list. Actual: the failure below.
With npx @react-native-community/[email protected] config in step 4, the config lists both platforms and "packageName": "com.reproducerapp".
React Native Version
0.89.0-nightly-20261030-4afc5d5b9
Affected Platforms
Build - Windows
Output of npx @react-native-community/cli info
System:
OS: Windows 11 10.0.26300
CPU: "(32) x64 AMD Ryzen 9 9950X3D 16-Core Processor "
Memory: 142.01 GB / 255.67 GB
Binaries:
Node:
version: 26.12.1
path: C:\Program Files\nodejs\node.EXE
Yarn:
version: 1.22.22
path: C:\Users\yevhe.YEVHENII\AppData\Roaming\npm\yarn.CMD
npm:
version: 12.2.1
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels:
- "33"
- "35"
- "35"
- "35"
- "36"
- "37"
- "37"
Build Tools:
- 35.0.0
- 36.0.0
- 36.1.0
- 37.0.0
System Images:
- android-26 | Google APIs Intel x86_64 Atom
- android-28 | Google APIs Intel x86_64 Atom
- android-29 | Google APIs Intel x86_64 Atom
- android-30 | Google APIs Intel x86_64 Atom
- android-31 | Google APIs Intel x86_64 Atom
- android-32 | Google APIs Intel x86_64 Atom
- android-33 | Google APIs Intel x86_64 Atom
- android-34 | Google APIs Intel x86_64 Atom
- android-35 | Google APIs Intel x86_64 Atom
- android-36.1 | Google Play Intel x86_64 Atom
- android-36.1 | Pre-Release 16 KB Page Size Google Play Intel x86_64 Atom
- android-37.0 | Google APIs Intel x86_64 Atom
Android NDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: AI-262.9437.185.2621.16467767
Visual Studio: Not Found
Languages:
Java:
version: 17.0.20.1
path: C:\Program Files\Microsoft\jdk-17.0.20.101-hotspot\bin\javac.EXE
Ruby: Not Found
npmPackages:
"@react-native-community/cli":
installed: 20.2.0
wanted: 20.2.0
react:
installed: 19.3.0
wanted: 19.3.0
react-native:
installed: 0.89.0-nightly-20261030-4afc5d5b9
wanted: 0.89.0-nightly-20261030-4afc5d5b9
react-native-windows: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Stacktrace or Logs
> npx react-native config
{
"root": "D:\\work\\contributions\\rn-nightly-cli-20-no-platforms\\ReproducerApp",
"reactNativePath": "D:\\work\\contributions\\rn-nightly-cli-20-no-platforms\\ReproducerApp\\node_modules\\react-native",
"reactNativeVersion": "0.89",
"dependencies": {},
"commands": [],
"healthChecks": [],
"platforms": {},
"assets": [],
"project": {}
}
> ./gradlew :app:generateAutolinkingPackageList
> Task :app:generateAutolinkingPackageList FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:generateAutolinkingPackageList'.
> RNGP - Autolinking: Could not find project.android.packageName in react-native config output! Could not autolink packages without this field.
MANDATORY Reproducer
https://github.com/YevheniiKotyrlo/rn-nightly-cli-20-no-platforms
Screenshots and Videos
No response
- Linguagem predominante
- C++
- Estrelas
- 127k
- Forks
- 25.4k
- Merge médio
- 2d 5h
- PRs com merge (30d)
- 74
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de react/react-native
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
react/react-native#59722 ·
Mantenedores costumam responder em até 2 dias
-
🌐Networking Needs: Author Feedback Needs: Repro Platform: Android
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
react/react-native#59704 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
Fantom runs end 5 seconds after their last test, with "Jest did not exit one second after the test run has completed": globalTeardown never clears its shutdown timerTalvez já em andamento @lazerg assumiu há 1 dia. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
react/react-native#59699 ·
Mantenedores costumam responder em até 2 dias
-
Android autolinking keeps a stale autolinking.json when only bun.lock changes, since bun.lock isn't in the default lockFilesTalvez já em andamento @lazerg assumiu há 1 dia. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
react/react-native#59693 ·
Mantenedores costumam responder em até 2 dias
-
Image.resolveAssetSource's TypeScript declaration drops the null it returns for an unknown assetTalvez já em andamento @Hassan1305 assumiu há 1 dia. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
react/react-native#59648 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
Todas as issues de react/react-native
Issues semelhantes
-
Bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 82/100
-
v3: Lua m.setvar() returns -1 on errors, so the script gets stack garbageTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta3.x bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
owasp-modsecurity/ModSecurity#3731 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Sendspin/sendspin-cpp-cli#111 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
azerothcore/azerothcore-wotlk#28350 ·
Mantenedores costumam responder em até 1 dia