Skip to content

Windows linebreaks in .nvmrc causes errors #1015

@mearns

Description

@mearns

If the .nvmrc file has a trailing windows-style linebreak (CR+LF), the version is not read correctly. Specifically, the CR is treated as part of the version string.

$ uname -a
Linux ubuntuTemplate 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
$ echo -e "v5.5.0\r\n" > .nvmrc
$ nvm use
>ound '/opt/fountain/.nvmrc' with version <v5.5.0
" is not yet installed

I realize windows as a platform isn't supported, but it's not too exceptional to have files created or edited in windows and used on linux or mac, and it's non-trivial to not have a trailing CR+LF on a text file edited in windows. Stripping all trailing whitespace from the version read from .nvmrc would resolve the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS: windowsbugsOh no, something's broken :-(pull request wantedThis is a great way to contribute! Help us out :-D

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions