Skip to content

[Bug / Docs] Usage of nvm is undocumented #15883

@calvinf

Description

@calvinf

Is this a bug report?

Yes.

Have you read the Contributing Guidelines?

Yes.

Environment

  1. react-native -v: react-native-cli: 2.0.1, react-native: 0.48.2
  2. node -v: v8.4.0
  3. npm -v: 5.3.0
  4. yarn --version: 1.0.1

Then, specify:

  • Target Platform: iOS
  • Development Operating System: macOS Sierra - 10.12.6 (16G29)
  • Build tools: XCode

Steps to Reproduce

(Write your steps here:)

  1. I forgot I had an old version of nvm installed that I'd never removed from my system and it was using Node v4.
  2. When react-native-xcode.sh ran, it used the version of node.js provided by nvm which is different from the default version of node.js on my system that I use for the rest of my development.

Expected Behavior

I expected to be told on the command line or in documentation that:

  1. A certain version of node or newer is required to support React Native.
  2. That nvm is used by the system if it is available. (Either directly installed or via brew.)

See react-native-xcode.sh.

Actual Behavior

My bundle failed due to using an old version of node via nvm without me knowing. None of the debugging instructions say anything about nvm being used.

I fixed the problem by uninstalling nvm on my system since I haven't been using it in development anymore.

Reproducible Demo

This should be reproducible by installing nvm and Node 4.x.

I'm not sure of a good way to share a reproducible demo since this is more of an environment configuration issue. I'd expect to occur with the React Native demo app, too.

Next steps

I'm interested in working on a "fix" for this issue by adding some documentation, but I could use some guidance on the best approach. Where in the docs does it make sense to add info about nvm?

The react-native-xcode.sh file doesn't log out anything about the node version being used -- is that something that would make sense to add?

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions