create-react-native-app: npm start fail for node 8.0.0 and npm 5.0.1 fresh install
First of all great work.
Description
npm start fails to start packager after a fresh install. See image below.

Environment
Please run these commands in the project folder and fill in their results:
npm ls react-native-scripts: 0.0.30npm ls react-native: 0.44.0npm ls expo: 17.0.0node -v: 8.0.0npm -v: 5.0.1yarn --version: –watchman version: –
- Operating system: ElementoryOS Loki
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 14
- Comments: 33 (9 by maintainers)
@aswerdlow935 -
npm i -g npm@4.6.1- then installcreate-react-native-appagain and create a project as per readme intructionsHey maintainers & contributors, great work.
A few months have passed and since the end of October, Node.js 8.x has entered LTS and all users installing node via the website (a vast majority I would assume) are installing this version. This ships with npm 5.
Any new users wanting to get started with (or contribute? support in some way?)
create-react-native-appnow hit a pretty awful barrier -create-react-native-appdoesn’t work with new node.js installations 😦As of writing, nodejs 8.9.1 LTS is shipping with npm 5.5.1 (at least on macOS). I haven’t researched it very deeply, but are the relevant npm bugs still a no-go for
create-react-native-app? It would be great to get an update on this even if it’s still a problem.Here’s the “new React Native dev” experience. Type React Native into Google. Click getting started. Download the recommended way to get started. Follow the recommended instructions. Get “sorry the current version of node/npm is not supported LOL” message in the console. Find dev comments saying they aren’t even working on fixing that. Give up on this degenerate ecosystem altogether.
How is this still not resolved…
Is there an easy way to downgrade from npm 5.0.3 to 4 that works with react native?
Hi! Thanks so much for the report!
This appears to be an issue with npm5, as I’m able to start the development server via yarn. We’ll try to identify a resolution soon! In the meantime, you can workaround this by installing yarn globally.
Using ‘npm install npm@4 -g’ solves the problem.
Downgrading npm to 4.6.1 fixed the issue and I can start a project with yarn start.
Looks like the start script is not checking if the project has been build by yarn and just checks for global npm version leading to false negative
I have same problem as @13hoop: I installed create-react-native-app using yarn and
yarn startshows that error about using npm version 5.0.3, although create-react-native-app is not installed trough npm but yarn.hi what about yarn? still same issues,info:
react-native-cli: 2.0.1 react-native: 0.44.3 yarn: 0.23.4 node: 8.0.0 expo: 17.0.0
@sasanazizi - this is a known issue, we say explicitly in README that you cannot use npm5 with create-react-native-app. I don’t recommend using npm5 at all right now (as of writing, latest version is 5.0.3) because it is too buggy
yes it is. We are using npm 3 and node 6
@sgb-io as far as I know npm 5’s behavior still doesn’t work for CRNA. If someone were to come along with a PR adding support there’s a good chance of merge, I’d wager, but we’re not working actively on it.
Is this still an issue with npm 6.0+?
Yes, it’s still a problem with npm 5.8… I had to use NPM 3 & node 7
@brentvatne : As updated in https://github.com/npm/npm/issues/16893, the current version of npm (5.6) seems to correctly handle
--save-devfollowed by a fullnpm install. Maybe it’s time to officially support npm 5?After switching to npm 5 and running
rm -rf node_modules/ && npm install, I haven’t had any problems so far.Hello! This is indeed a npm5 issue and I have reported it upstream here: https://github.com/npm/npm/issues/16893
npm5 is currently buggy, I recommend you use npm4 or yarn. (the same recommendation applies for create-react-app).
Any update on this for npm 5.8? I know March 18 (last comment) isn’t that long ago, but I haven’t seen any mention of 5.7 or 5.8 in this thread.
Does “this will no longer be an issue” mean that everything works properly, or that it mostly works?
Thanks!
No, I’m happy with npm 5 and I’ve had zero problems so far.
@13hoop - yarn works but you need to re-create the project or delete node_modules and run
yarn installagain. the problem with npm5 is that it installs the dependencies incorrectly when you create the project.i have the same issue on ubuntu 16.04 using npm 5.0.2 when i want create a new app with create-react-native-app , result is : `
ERROR: npm 5 is not supported yet
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
`
@mirosa06 - this is a npm bug as I mentioned above (npm/npm#16893), please use an older version of npm (preferably 4.x) or yarn
I have the same issue on win 7 using npm 5.0.1 Looks like there is a problem with the path -->
11:59:04: Error starting packager: Error: Couldn't start project. Please fix the errors and restart the project. at D:\xdl\src\Project.js:1039:11I dont have such directory : D:\xdlSame npm5 bug as #2436
x-ref: npm/npm#16839
I have same issue with node v8 on Mac OS
Edit : works with node v7.10