Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.75.0-rc.2]: npm error when running npx react-native@next init #45189

Closed
migueldaipre opened this issue Jun 26, 2024 · 8 comments
Closed

[0.75.0-rc.2]: npm error when running npx react-native@next init #45189

migueldaipre opened this issue Jun 26, 2024 · 8 comments
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Triage 🔍

Comments

@migueldaipre
Copy link
Contributor

Description

Error creating a project from scratch with the command suggested on the release page.

npx react-native@next init RN75 --version next

Running npx react-native@0.75.0-rc.2 init Vision75 --version 0.75.0-rc.2 works.

Steps to reproduce

  1. Run npx react-native@next init Vision75 --version next
  2. Error appears in the console

React Native Version

0.75.0-rc.2

Affected Platforms

Runtime - Android, Runtime - iOS

Output of npx react-native info

error: unknown command 'info'
(Did you mean init?)

Stacktrace or Logs

31 error code ERESOLVE
32 error ERESOLVE could not resolve
33 error
34 error While resolving: undefined@undefined
34 error Found: react-native@0.74.0-rc.6�[2m�[22m
34 error �[2mnode_modules/react-native�[22m
34 error   �[95mpeer�[39m react-native@"*" from @react-native/virtualized-lists@0.74.77�[2m�[22m
34 error   �[2mnode_modules/@react-native/virtualized-lists�[22m
34 error     @react-native/virtualized-lists@"0.74.77" from react-native@0.74.0-rc.6
34 error   react-native@"0.75.0-rc.2" from the root project
34 error
34 error Could not resolve dependency:
34 error react-native@"0.75.0-rc.2" from the root project
34 error
34 error Conflicting peer dependency: react@19.0.0-rc-fb9a90fa48-20240614�[2m�[22m
34 error �[2mnode_modules/react�[22m
34 error   �[95mpeer�[39m react@"^19.0.0-rc-fb9a90fa48-20240614" from react-native@0.75.0-rc.2�[2m�[22m
34 error   �[2mnode_modules/react-native�[22m
34 error     react-native@"0.75.0-rc.2" from the root project
34 error
34 error Fix the upstream dependency conflict, or retry
34 error this command with --force or --legacy-peer-deps
34 error to accept an incorrect (and potentially broken) dependency resolution.
35 error
35 error
35 error For a full report see:
35 error /Users/migueldaipre/.npm/_logs/2024-06-26T16_10_00_472Z-eresolve-report.txt
36 silly unfinished npm timer reify 1719418203004
37 silly unfinished npm timer reify:loadTrees 1719418203006
38 silly unfinished npm timer idealTree:buildDeps 1719418203122
39 silly unfinished npm timer idealTree:#root 1719418203122

Reproducer

not possible

Screenshots and Videos

image

@github-actions github-actions bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Jun 26, 2024
Copy link

⚠️ Missing Reproducible Example
ℹ️ We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.

@jabedzaman
Copy link

got the fix?? having something similar issue.... it stucked at downloading template... although i m on a high speed internet

@imWildCat
Copy link

use this npx react-native@0.75.0-rc.2 init AwesomeProject7 --version 0.75.0-rc.2

@cortinico
Copy link
Contributor

@migueldaipre do you happen to have react-native or the CLI installed globally?

@migueldaipre
Copy link
Contributor Author

@migueldaipre do you happen to have react-native or the CLI installed globally?

None at all, but running npx react-native@0.75.0-rc.2 init AwesomeProject --version 0.75.0-rc.2 it's work.

It seems to me that the problem is with the npm next tag.

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Jun 27, 2024
@cortinico
Copy link
Contributor

This is how the command behaves on my machine:
Screenshot 2024-07-01 at 12 50 14

@migueldaipre could you try to delete this folder:

rm -rf ~/.npm/_npx

and try again? I have the suspect this is due to the CLI previously registering a binary called react-native that now is missing.

@migueldaipre
Copy link
Contributor Author

This is how the command behaves on my machine: Screenshot 2024-07-01 at 12 50 14

@migueldaipre could you try to delete this folder:

rm -rf ~/.npm/_npx

and try again? I have the suspect this is due to the CLI previously registering a binary called react-native that now is missing.

It's worked.

  1. rm -rf ~/.npm/_npx
  2. npx react-native@next init RN75 --version next

works

Thank you @cortinico 🎉

@Titozzz
Copy link
Collaborator

Titozzz commented Jul 1, 2024

So what's happening is you already have in your cache some version that satisfies the "@next" constraint, let's say you test a previous RC so npx won't fetch the 'latest' @next but will use your cache. So nuking the cache is a way to fix it, or using an explicit "@0.75.0-rc.X" will also work.

"@latest" seems to work as it will always fetch the latest version but it's probably an edge case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Triage 🔍
Projects
None yet
Development

No branches or pull requests

5 participants