1

I am currently trying to get started with react native.

I set up the development environment referring to the documentation, but can't even pass the first step and create an empty project.

I am on Windows 11, Node 16.15.1, and NPM 8.12.2

I keep getting the following error when trying to init react-ative project with expo init awesomeProject

Error downloading and extracting template package: Error: npm exited with non-zero code: 1
× Something went wrong while downloading and extracting the template.

Can't read JSON file: D:\crna\awesomeProject\app.json
└─ Cause: Error: ENOENT: no such file or directory, open 'D:\crna\awesomeProject\app.json'

screenshot of the error transcribed above

Does anyone has a suggestion ?

4 Answers 4

2

Clear your npm cache and try again. You can use the command "npm cache clean --force" to clear your cache. This may help if your cache is corrupted or contains invalid data. I hope this is helpful for you.

Sign up to request clarification or add additional context in comments.

Comments

0

Same error.

Probably there are something wrong with npx/npm, try npx -v or npm -v to check if npx/npm works properly.

I found my npm/npx system environment variable path is duplicated and after I deleted the wrong one and reboot my system, it works.

Then I tried expo init and everything goes perfect.

Comments

-1

Don't really know what is the problem but i found a soluion that might help other people in the same situation as me! like said here just run in CMD instead of GitBash

Comments

-1

Use sudo if on linux. And maybe Admin on windows.

3 Comments

Hi and welcome! Take the tour and have a look at How to Answer, it should help explain that you'll need to back up your answer to explain why you think it's correct.
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.