Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm start fail for node 8.0.0 and npm 5.0.1 fresh install #233

Closed
uxxman opened this issue Jun 1, 2017 · 33 comments
Closed

npm start fail for node 8.0.0 and npm 5.0.1 fresh install #233

uxxman opened this issue Jun 1, 2017 · 33 comments

Comments

@uxxman
Copy link

uxxman commented Jun 1, 2017

First of all great work.

Description

npm start fails to start packager after a fresh install. See image below.

screenshot from 2017-06-01 15 38 23

Environment

Please run these commands in the project folder and fill in their results:

  • npm ls react-native-scripts: 0.0.30
  • npm ls react-native: 0.44.0
  • npm ls expo: 17.0.0
  • node -v: 8.0.0
  • npm -v: 5.0.1
  • yarn --version: --
  • watchman version: --
  1. Operating system: ElementoryOS Loki
@prashanthmadi
Copy link

prashanthmadi commented Jun 1, 2017

I have same issue with node v8 on Mac OS

Edit : works with node v7.10

@anp
Copy link
Contributor

anp commented Jun 1, 2017

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.

@brentvatne
Copy link
Member

brentvatne commented Jun 1, 2017

Hello! This is indeed a npm5 issue and I have reported it upstream here: npm/npm#16893

npm5 is currently buggy, I recommend you use npm4 or yarn. (the same recommendation applies for create-react-app).

@brentvatne brentvatne changed the title npm starts fail for node 8.0.0 and npm 5.0.1 fresh install npm start fail for node 8.0.0 and npm 5.0.1 fresh install Jun 1, 2017
@cr101
Copy link

cr101 commented Jun 2, 2017

Same npm5 bug as #2436

x-ref: npm/npm#16839

@mlsks
Copy link

mlsks commented Jun 2, 2017

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:11
I dont have such directory : D:\xdl

@brentvatne
Copy link
Member

@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

@sasanazizi
Copy link

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:
npm/npm#16991


`

@brentvatne
Copy link
Member

@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

@13hoop
Copy link

13hoop commented Jun 16, 2017

hi
what about yarn? still same issues,info:

yarn run v0.23.4
$ react-native-scripts ios
20:05:59: Starting packager...
20:05:59: Error starting packager: Error: Couldn't start project. Please fix the errors and restart the project.
    at /xdl/src/Project.js:1039:11
    at Generator.next (<anonymous>)
    at step (/Users/xxx/gitHub Code/YRReactNative/AwesomeProject/node_modules/xdl/build/Project.js:1461:191)
    at /Users/xxx/gitHub Code/YRReactNative/AwesomeProject/node_modules/xdl/build/Project.js:1461:361
    at <anonymous>
error Command failed with exit code 1.

react-native-cli: 2.0.1
react-native: 0.44.3
yarn: 0.23.4
node: 8.0.0
expo: 17.0.0

@brentvatne
Copy link
Member

@13hoop - yarn works but you need to re-create the project or delete node_modules and run yarn install again. the problem with npm5 is that it installs the dependencies incorrectly when you create the project.

@aswerdlow935
Copy link

Is there an easy way to downgrade from npm 5.0.3 to 4 that works with react native?

@brentvatne
Copy link
Member

brentvatne commented Jun 18, 2017

@aswerdlow935 - npm i -g npm@4.6.1 - then install create-react-native-app again and create a project as per readme intructions

@piotr-cz
Copy link

I have same problem as @13hoop:
I installed create-react-native-app using yarn and yarn start shows that error about using npm version 5.0.3, although create-react-native-app is not installed trough npm but yarn.

@piotr-cz
Copy link

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

@brentvatne
Copy link
Member

newer versions of npm 5 seem to work, but we don't use them and there may be unexpected bugs as i'm not sure if it's stable yet, so we provide a soft warning.

@maazrk
Copy link

maazrk commented Aug 9, 2017

Using 'npm install npm@4 -g' solves the problem.

@panuhorsmalahti
Copy link

npm 5.3.0 is stable, but is still not supported. Any idea when this issue is going to be fixed?

@piotr-cz
Copy link

@panuhorsmalahti I suggest you switch to yarn.
I did so after other problems with npm 5.3, 5.4, 5.2 and 4.6.1.

@panuhorsmalahti
Copy link

No, I'm happy with npm 5 and I've had zero problems so far.

@brentvatne
Copy link
Member

npm 5.3.0 has a lot of bugs: npm/npm#16991
in particular, this one makes it not work so well with create-react-native-app: npm/npm#16893

this issue isn't going to be fixed in create-react-native-app because it's not a bug in create-react-native-app, it's a bug in npm.

@sgb-io
Copy link

sgb-io commented Nov 29, 2017

Hey 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-app now hit a pretty awful barrier - create-react-native-app doesn'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.

@ramshankerji
Copy link

Hi There, apparently it's now failing for a fresh install. Any idea how to resolve? I can't seem to find an official documentation.

@anp
Copy link
Contributor

anp commented Jan 3, 2018

@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.

@ghost
Copy link

ghost commented Jan 13, 2018

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.

@elmbrent
Copy link

How is this still not resolved...

@varunchandran333
Copy link

screenshot_1517372014

When does it comes??

@treyp
Copy link

treyp commented Feb 28, 2018

@brentvatne : As updated in npm/npm#16893, the current version of npm (5.6) seems to correctly handle --save-dev followed by a full npm 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.

@jamesqo
Copy link

jamesqo commented Mar 11, 2018

What is the fix for this if you are using NPM 5? I mean it's the default installation that comes with Node 8.1.0 when you download it from the site. Is it still recommended to downgrade to NPM 4?

@binki
Copy link

binki commented Mar 18, 2018

@jamesqo My workaround is to install a local version of npm4. For example (assuming POSIX-like shell):

$ mkdir ~/npm4-fun
$ pushd ~/npm4-fun
$ npm init -y
$ npm install -S npm@4
$ popd
$ export PATH=~/npm4-fun/node_modules/.bin:${PATH}
$ /path/to/create-react-native-app my-native-app

Don’t forget that all uses of npm in your shell and subshells will now point to your local npm4 version because of the PATH modification. You probably want to exit the shell or use a different shell for your other projects to use npm5 where you can. Or you can avoid the export by invoking create-react-native-app this way:

$ PATH=~/npm4-fun/node_modules/.bin:${PATH} /path/to/create-react-native-app my-native-app

When the scripts are updated to not error out on npm-5 and once you can upgrade to a nodejs version that includes at least npm-5.6, this will no longer be an issue.

@Ajacmac
Copy link

Ajacmac commented Apr 17, 2018

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!

@cleuton
Copy link

cleuton commented Apr 25, 2018

Yes, it's still a problem with npm 5.8... I had to use NPM 3 & node 7

@mrmcduff
Copy link

mrmcduff commented Jun 7, 2018

Is this still an issue with npm 6.0+?

@sebastianovide
Copy link

yes it is. We are using npm 3 and node 6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests