Skip to content

nvm install 5 fails unless nvm ls before #1216

@hedefalk

Description

@hedefalk

nvm install 5 fails unless I previously did a nvm ls. So nvm ls is obviously not idempotent which is a bit weird?

$ . "$NVM_DIR/nvm.sh"
$ nvm install 5.0 || true
$ nvm use 5.0 || true
Version '5.0' not found - try `nvm ls-remote` to browse available versions.
N/A: version "N/A" is not yet installed.

You need to run "nvm install N/A" to install it before using it.
$ cd $DRONE_DIR
$ rm -rf node_modules
/bin/sh: 46: npm: not found

If I just add a nvm ls before it works:

$ git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" origin`
Note: checking out 'v0.31.6'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 31c68ad... v0.31.6
$ . "$NVM_DIR/nvm.sh"
$ nvm ls || true
            N/A
node -> stable (-> N/A) (default)
$ nvm install 5.0 || true
Downloading https://nodejs.org/dist/v5.0.0/node-v5.0.0-linux-x64.tar.xz...
######################################################################## 100.0%
Now using node v5.0.0 (npm v3.3.6)
Creating default alias: default -> 5.0 (-> v5.0.0 *)
$ nvm use 5.0 || true
Now using node v5.0.0 (npm v3.3.6)

Metadata

Metadata

Assignees

Labels

bugsOh no, something's broken :-(installing nodeIssues with installing node/io.js versions.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions