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

nvm install 5 fails unless nvm ls before #1216

Closed
hedefalk opened this issue Aug 26, 2016 · 3 comments
Closed

nvm install 5 fails unless nvm ls before #1216

hedefalk opened this issue Aug 26, 2016 · 3 comments
Assignees
Labels
bugs Oh no, something's broken :-( installing node Issues with installing node/io.js versions.

Comments

@hedefalk
Copy link

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)
@ljharb
Copy link
Member

ljharb commented Aug 26, 2016

Prior to doing an nvm ls, can you run set -ex; nvm install 5.0 and provide the output?

The || trues are likely masking errors, so it'd be ideal to remove those :-)

@ljharb ljharb added installing node Issues with installing node/io.js versions. needs followup We need some info or action from whoever filed this issue/PR. labels Aug 26, 2016
@hedefalk
Copy link
Author

https://gist.github.com/hedefalk/e1e6d1ddc60ae97ac5ea3bffe3f34afb

Sorry, || true because #993 - basically my build fails on on everything without because set -e from surrounding environment.

@ljharb ljharb closed this as completed in 6abc36e Aug 29, 2016
@ljharb
Copy link
Member

ljharb commented Aug 29, 2016

Thanks, I think that cleared it up.

@ljharb ljharb added bugs Oh no, something's broken :-( and removed needs followup We need some info or action from whoever filed this issue/PR. labels Aug 29, 2016
@ljharb ljharb self-assigned this Aug 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugs Oh no, something's broken :-( installing node Issues with installing node/io.js versions.
Projects
None yet
Development

No branches or pull requests

2 participants