question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react-native-cli is not compatible with npm@5

See original GitHub issue

Is this a bug report?

Yes

Have you read the Bugs section of the Contributing to React Native Guide?

Yes

Environment

  1. react-native -v:
react-native-cli: 2.0.1
react-native: 0.45.1
  1. node -v:
v8.1.1
  1. npm -v:
5.0.4
  1. yarn --version (if you use Yarn): 0.23.2

Then, specify:

  1. Target Platform (e.g. iOS, Android): Whatever the result of yarn start is
  2. Development Operating System (e.g. macOS Sierra, Windows 10): macOS Sierra
  3. Build tools (Xcode or Android Studio version, iOS or Android SDK version, if relevant): Not relevant

Steps to Reproduce

Perform the first four steps outlined in the Getting Started (https://facebook.github.io/react-native/docs/getting-started.html) guide with a totally fresh React Native project.

  1. npm install -g create-react-native-app
  2. create-react-native-app AwesomeProject
  3. cd AwesomeProject
  4. npm start

Expected Behavior

I thought a dev server would run, or I would see the QR code mentioned in the Getting Started guide. I would expect react-native to be compatible with npm 5.0.4 or give instructions as to how to downgrade (not ideal). I wouldn’t expect it to just outright break.

Actual Behavior

➜  /Users/foo/TestApp npm start

> TestApp@0.1.0 start /Users/foo/TestApp
> react-native-scripts start

1:54:47 PM: Starting packager...
***ERROR STARTING PACKAGER***

Error: You are using npm version 5.0.4. Please use an npm version that is >= 3.0.0 and < 5.0.0.
1:54:47 PM: Error starting packager: Error: Couldn't start project. Please fix the errors and restart the project.
    at /xdl/src/Project.js:1038:11
    at Generator.next (<anonymous>)
    at step (/Users/foo/TestApp/node_modules/xdl/build/Project.js:1468:191)
    at /Users/foo/TestApp/node_modules/xdl/build/Project.js:1468:361
    at <anonymous>
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! TestApp@0.1.0 start: `react-native-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the TestApp@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/foo/.npm/_logs/2017-06-28T20_54_47_593Z-debug.log

Reproducible Demo

Explained above.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:28
  • Comments:34 (6 by maintainers)

github_iconTop GitHub Comments

170reactions
floriancargoetcommented, Jun 30, 2017

You can downgrade npm with: npm install -g npm@4

58reactions
ankitpopli1891commented, Jul 2, 2017

Quoting @johndanek again,

I would expect react-native to be compatible with npm 5.0.4 or give instructions as to how to downgrade (not ideal)

We understand that react-native or react-native-cli might not be responsible for the bug, but as the naive users, we do expect it to work gracefully.

It’d be great if someone can explain the issue, rather than just telling us to downgrade. It would not only help us understand the issue, but we might be able to contribute as well. Even if can’t, we’ll be able to raise the issue in the right repository.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NPM 5 is not supported yet in React Native - node.js
While creating an app using React native, in cmd I'm facing the following error message: ERROR: npm 5 is not supported yet. npm...
Read more >
react-native-cli - npm
Start using react-native-cli in your project by running `npm i ... your local github clone into npm is not enough to test local...
Read more >
Building Mobile App with React Native - Draft @ https ...
Create React Native App doesn't work with npm 5 yet, unfortunately. We recommend using npm 4 or yarn until some bugs are resolved....
Read more >
These NPM tricks will make you a pro - freeCodeCamp
Grunt, gulp, react-create-app, react-native-cli and mocha are just a few. Before NPM 5.x you had to install these tools either as global ...
Read more >
[React Native] 프로젝트 생성하기(create-react-native-app ...
ERROR : npm 5 is not supported yet ... Create React Native App doesn't work with npm 5 yet, unfortunately. We.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found