I am not able to run the project using yarn start. I didn't get any hint on this error.
Error: You are using npm version 5.0.3. Please use an npm version that is >= 3.0.0 and < 5.0.0.
9:08:07 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 next (native)
at step (/home/medinesh/Documents/upwork/boilerplate/node_modules/xdl/build/Project.js:1468:191)
at /home/medinesh/Documents/upwork/boilerplate/node_modules/xdl/build/Project.js:1468:361
at process._tickCallback (internal/process/next_tick.js:109:7)
error Command failed with exit code 1.
Hey man,
The hint is right there: Please use an npm version that is >= 3.0.0 and < 5.0.0.
I just got the same issue and am thinking of going back to an earlier version of npm to be able to use this project.
Good luck!
The project clearly states in README.md the following
You'll need to have Node v6 or later on your machine. We strongly recommend using npm v3, v4, or a recent version of Yarn. Create React Native App does not currently work with npm v5 due to bugs in npm.
Hey!
Anyone has made tests with the latest NPM v5.0.4 ?
NPM v5.0.4 seems to bring the fix
If this issues is related to
https://github.com/npm/npm/issues/16893
Then, i've reproduced @brentvatne under 5.0.3 but it works under .4
package-lock looks good
Is there any way to downgrade npm except deleting and installing node again?
@Noor0 npm i -g [email protected] where x.x.x is version number to
thanks @sixertoy! I'll give it a try
Ran into this as well. The error says I have v5.0.0 installed, but I when I check the version, I see the following. Not sure what's going on here.
➜ test_proj npm -v
3.10.7
@Monte9 What if you do
$ npm --version
not in the project directory, but globally?
Good point. Tried that but it's still the same. Still shows me 3.10.7
@Monte9 running npm install [email protected] in the project directory saved me
Seems they have weakened the check for npm version in the latest xdl:
https://github.com/expo/xdl/commit/224cf7a925e842d61490d2ce63b3bf79f68a93f0
(comment from here: https://github.com/sysgears/apollo-universal-starter-kit/issues/221#issuecomment-3112650790)
the xdl version with the fix to WARNING is 42.3.0 (just now it is 42.0.0
( https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/package.json#L38 )
You can also add npm via yarn to this project yarn add [email protected]
Cause npm install <package name> will remove all other package for npm5 in yarn project like react native.
So also recommend just using yarn add [email protected]
But it will only change npm version in the project,if you want to active for all other project can using npm install [email protected] -g
this [email protected] is just a workaround with downgrading :(
@muescha - not sure what you want us to do about that, our next release will remove the error message, but we absolutely needed it because too many people had issues with the project not working with npm 5. a workaround is sometimes necessary when there is buggy software in the ecosystem, like npm 5.0.0 -> npm 5.0.3. we had no way of knowing in advance what version of npm would resolve the problem so we just checked >= 5.0.0
i understand workarounds are needed. but why workarounds when it can solved with an dependency.
when exact this error line xdl/src/Project.js:1038:11 comes from an thrown FATAL in xdl version 42.0.0 and this is fixed in 42.3.0 of xdl ( see https://github.com/expo/xdl/commit/224cf7a925e842d61490d2ce63b3bf79f68a93f0 )
why not upgrade the dependency of xdl from 42.0.0 to 42.3.0 in the package.json?
I'm having this error but I'm running with "yarn run android", not "npm run android".
Error: You are using npm version 5.2.0. Please use an npm version that is >= 3.0.0 and < 5.0.0.
😞
I already downgraded and using npm 4.6.1 globally now, but why am I still seeing Error: You are using npm version 5.0.3. Please use an npm version that is >= 3.0.0 and < 5.0.0. Run 'npm i -g [email protected]' to resolve. ?
I tried installing npm locally like @shkfnly suggested too and it doesn't work :(
It seems to work with newer versions of npm. I upgraded by doing npm install -g npm, which installed npm 5.3.0. After this, the warning went away.
this is fixed in the latest version of react-native-scripts, you can update your project to it if you like, or create a new project and you will get it automatically
@brentvatne I get this error using 1.5.0 of react-native-scripts. Is there a newer version?
It's confusing because I'm trying to use yarn, not npm:
$ yarn ios
yarn ios v0.24.6
$ react-native-scripts ios
11:23:33: Starting packager...
***ERROR STARTING PACKAGER***
Error: You are using npm version 5.0.3. We recommend version 4.6.1. To install it, run 'npm i -g [email protected]'.
11:23:41: Starting simulator...
Use this command ( npm install -g npm@latest ) and the problem should be solved as it will install the latest version of npm.
Most helpful comment
@Noor0
npm i -g [email protected]where x.x.x is version number to