Continuing from #262
I've having a helluva time getting this to work with Jenkins running Phing, which uses
sh(so it doesn't load bash_profile). Manually adding the. ~/.nvm/nvm.sh(orbash ~/.nvm/nvm.sh) causes it to complain:N/A: version "N/A" is not yet installed.Evennvm listcauses this error.
Thanks! can you provide the output of nvm debug, and the contents of your .nvmrc file?
You'd definitely want to source it with . or else it won't run in the current shell environment, in sh as well.
@ljharb Our Release Manager did use the install script from master.
Contents of .nvmrc:
0.10.28
I asked the Release Manager to provide the debug output. I'll post it when he gets back to me.
Thanks! (as an aside, 0.10.28 is missing tons of security patches, and you really want to be on 0.10.46 even if you're stuck on 0.10)
the only thing we're using it for is build stuff, but thanks! this project is so old, it's a house of cards.
nvm debug:
~$ nvm debug
nvm --version: v0.31.4
$SHELL: /bin/bash
$HOME: /var/lib/jenkins
$NVM_DIR: '$HOME/.nvm'
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
nvm current: system
which node: /usr/local/bin/node
which iojs:
which npm: /usr/local/bin/npm
npm config get prefix: /usr/local
npm root -g: /usr/local/lib/node_modules
ok, so - a system node (what version is that on, btw? nvm use system && node --version assuming that works); everything else looks fine; can you cd "$NVM_DIR" && ls -la and paste that output?
What's the full path to your .nvmrc?
If you explicitly nvm install 0.10.whatever does it work?
The full path to .nvmrc is the projectroot, so something like /Users/Jenkins/20u300t62040t6y/workspace/.nvmrc
I'm pretty sure I won't be allowed to provide the contents of a listing of the home directory.
The system Node is 4-something.
oh i'm not looking for the contents of the home directory - i'm looking for the .nvm dir inside the home directory.
Ah. It's there. I already had the RM run that to verify.
Right - I was hoping to get the list of contents of .nvm :-) specifically, the versions directly inside it, and the contents of its "alias" and "versions/node" subdirs
Oh, duh. $NVM_DIR is not the home dir. Der! haha
Do you want anything else? Each time you ask for something, the RM has to SSH back into the box and get it.
I think that covers it - just confirming which versions are already installed, and which aliases are present, when nvm ls doesn't work. I'll try to minimize/group requests like this :-)
nvm list DOES work, but not when run by Phing.
aha, ok interesting. is phing posix-compliant? i can't find any mention of that on their website.
Btw in case you're still interested
$ nvm list
聽 聽 v0.10.28
-> 聽 system
default -> system
node -> stable (-> v0.10.28) (default)
stable -> 0.10 (-> v0.10.28) (default)
iojs -> N/A (default)
I know almost nothing about Phing.
At this point without an interactive terminal using Phing I'm not sure how I can poke at things and figure it out. We could try, on Phing, nvm_version 0.10.28, nvm_is_version_installed 0.10.28, nvm_ensure_version_installed 0.10.28, ie some of the building blocks that are used.
I had the same problem with nvm v0.32.0.
nvm debug:
nvm --version: v0.32.0
$SHELL: /bin/bash
$HOME: /home/meiryasuda
$NVM_DIR: '$HOME/.nvm'
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
nvm current: system
which node: /usr/bin/node
which iojs:
which npm: /usr/bin/npm
npm config get prefix: /usr
npm root -g: /usr/lib/node_modules
nvm ls:
iojs-v3.3.1
v4.2.2
-> system
default -> 4.2.2 (-> N/A)
node -> stable (-> v4.2.2) (default)
stable -> 4.2 (-> v4.2.2) (default)
iojs -> iojs-v3.3 (-> iojs-v3.3.1) (default)
lts/* -> lts/argon (-> N/A)
lts/argon -> v4.6.0 (-> N/A)
And I have a node version (v6.x) that isn't in this list. I don't know if is related, but sounds wierd to me.
@meiryasuda what happens when you run nvm use 4? also, what leads you to believe that you have a v6 node that's not in the list? note that "system" will display for your non-nvm-managed node, no matter what version it is.
ah, got it! I installed without nvm: https://github.com/nodesource/distributions#installation-instructions, make sense to be displayed as non-nvm-managed node.
In that list, I had two versions with "N/A" displayed, so I used the command nvm install 4.2.2 and nvm install 4.6.0 that updated my node versions list. Now, everything is fine! :)
I had this issue, for me it was caused by me deleting node versions provided by NVM without using NVM. I had custom aliases left behind that referenced the versions that I'd deleted. Removing those stale aliases stopped the error from showing up for me.
I installed node using:
$ nvm install --lts
some days later, after I run " nvm list-remote "
and if there is new version for LTS
after re-login to bash, it will encounter this error:
N/A: version "N/A -> N/A" is not yet installed.
You need to run "nvm install N/A" to install it before using it.
I am not quite sure about the above steps will reproduce the error, but I have encountered this error several times on both Ubuntu and Debian.
@snoleo please file a new issue, and fill out the issue template.
I'm going to close this; anyone still experiencing problems, please file a new issue with a filled-out template.
Most helpful comment
I had this issue, for me it was caused by me deleting node versions provided by NVM without using NVM. I had custom aliases left behind that referenced the versions that I'd deleted. Removing those stale aliases stopped the error from showing up for me.