RN Expo issue - Something when wrong installing JavaScript dependencies. Check your npm logs. Continuing to initialize the app

Viewed 7794

I am using react native and Expo. I am unable to build new app because after I use expo init appName it shows the following error. Heres the full message:

 Using npm to install packages. You can pass --yarn to use Yarn instead.

√ Downloaded and extracted project files.
× Something when wrong installing JavaScript dependencies. Check your npm logs. Continuing to initialize the app.

✅ Your project is ready!

To run your project, navigate to the directory and run one of the following npm commands.

- cd Scanner
- npm start # you can open iOS, Android, or web from here, or run them directly with the commands below.
- npm run android
- npm run ios # requires an iOS device or macOS for access to an iOS simulator
- npm run web

I tried multiple times to create a blank project, also tried npm install to install failed/not downloaded libraries and continue after failure but it showed another error:

npm ERR! code Z_BUF_ERROR
npm ERR! errno -5
npm ERR! zlib: unexpected end of file

also tried npm cache verify that showed cache is ok Content verified: 3562 (252580364 bytes).

So, How can I solve this issue?

8 Answers

Problems related to npm installation are very common If you do any mistake in early installation, but is avoided. Learn more about npm tree.

Steps worked for me are :

  1. npm cache clean --force

  2. npm cache verify

  3. npm -g uninstall expo-cli --save

  4. npm install expo-cli --global

  5. expo init app-name

  6. cd app-name

  7. npm start

Always run as administrator if working on Windows and in root directory.

The solutions above didn't work for me but if you use 'npm install' in the directory of the app you get a clue that you shuold try 'npm install --force' err message

You should have all these files folders and files at the start of the project otherwise not all the dependencies have been installed which is why we were getting the problem.folder structure

After you have added --force to npm install you have all the dependencies installed. Now you can run the app with npm start.

I just did npm install and it worked for me, but I had do that every time I create a new expo project.

I also encountered this problem, and finally found that it was the problem of react native cli,I installed the latest version of react native cli,Expo is back to normal

Unfortunately, all the solutions described above didn't work on my machine... Here is my latest solution for this problem... This worked 100% on my machine... Use npm i -g expo-cli This will automatically add the required packages and also remove the unnecessary ones. Yes, surely, you don't need to uninstall and re-install it again. Just follow my steps. And, you can create your expo project using expo init. I hope my solution will help you out from this annoying problem....

This Error is regarding to the git account. expos need a git account to setup react native project

If you are using windows you need to install git in your local PC after that open your Terminal and type this command

git config --global user.name "your_username"

git config --global user.email "your_email_address@example.com"

after that clone any github project to your local computer. it will ask to login to Github

after all these steps try expo init <projectname>

The simple way to settle that error is by using "expo-cli init app-name" instead of "expo init app-name".

I tried and worked perfectly for me. Hope it will help you guys.

i have faced a similar problem and running yarn set version 1.22.1 fix it

Related