Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NPM 5 is not supported yet in React Native

Tags:

node.js

npm

While creating an app using React native, in cmd I'm facing the following error message:

ERROR: npm 5 is not supported yet.

npm WARN deprecated [email protected]: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0

> @expo/[email protected] postinstall C:\Users\Rakesh\proj\node_modules\@expo\ngrok > node ./postinstall.js ngrok - binary unpacked.

npm notice created a lockfile as package-lock.json. You should commit this file. + [email protected] added 459 packages in 316.717s.

It looks like you're using npm 5, which was recently released. Create React Native App doesn't work with npm 5 yet, unfortunately. We recommend using npm 4 or yarn until some bugs are resolved. You can follow the known issues with npm 5 at: https://github.com/npm/npm/issues/16991

like image 847
Rakesh Avatar asked Jan 28 '23 11:01

Rakesh


2 Answers

You can downgrade your npm version by following

npm install [email protected] -g

and then try running app again.

like image 91
Ridham Tarpara Avatar answered Jan 31 '23 01:01

Ridham Tarpara


Simply downgrade npm to 4.6.1 OR Install Yarn

npm install -g [email protected]

OR

npm install -g yarn

Yarn is better but I will prefer to downgrade npm because for some reason I'm getting a yarn.lock file error.

like image 34
MJ Sabri Avatar answered Jan 31 '23 00:01

MJ Sabri