-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
node not found after install #994
Comments
What's |
oh, sorry:
|
@v21 is there any chance that your $HOME directory is a symlink? What happens if you run |
No, not a symlink. And running
|
furthermore:
versus
getting to the root of the problem, i think:
|
I am fairly sure the problem is that nvm.sh's architecture detection doesn't account for the fact that you can run a 32 bit userland on a 64 bit kernel. Specifically, this bit here: https://github.com/creationix/nvm/blob/754a0d7c5b28d4b1ae2c5ad91f9db8b51f54df56/nvm.sh#L984 (why am I running a 32 bit userland on a 64 bit kernel? because Linode offered me a server upgrade. I didn't know I was til I started digging into this) |
fwiw, modern nodes don't work on 32 bit systems, so that definitely might be causing some problems. If you wanted to help write tests + a PR to account for this, that would be great! |
I can confirm this issue on systems with a 32bit userland / 64bit kernel. I'm using such a setup at my workplace because we have a memory constrained application where we don't want the overhead of 64bit pointers, but need a 64bit kernel for certain virtual machine providers. I think that there is a valid use case for wanting to install a node that doesn't match the output of One approach which works for me, but is specific to Debian and its derivatives is to ask dpkg what architecture it has, since it will be unlikely that a user has dpkg installing packages of a completely wrong arch. The following patch was all it took to get this working for Ubuntu: diff --git a/nvm.sh b/nvm.sh
index ce5c6b5..75669a3 100644
--- a/nvm.sh
+++ b/nvm.sh
@@ -1135,7 +1135,13 @@ nvm_get_arch() {
HOST_ARCH=$(isainfo -n)
fi
else
- HOST_ARCH="$(uname -m)"
+ # On Debian and its derivatives, check to see if the
+ # userland is 32-bit according to DPKG output.
+ if command -v dpkg > /dev/null ; then
+ HOST_ARCH="$(dpkg --print-architecture)"
+ else
+ HOST_ARCH="$(uname -m)"
+ fi
fi
local NVM_ARCH But this probably isn't a very widely applicable approach in general. Another approach might be to check I guess my questions are:
|
@oslerw architecture support is one of the things I'm OK with having have lots of platform-specific detections in. The main concern is testability - it's really hard to test these things, and I'd want to have lots of confidence that no current platforms that work, would stop working. |
This is related to #672 |
Seeing the same error on every version I try. nvm version is 0.30.2. I'm running Ubuntu 12.04.5 LTS (GNU/Linux 4.1.5-x86_64-linode61 x86_64) with bash. I have an install of 0.10 still working via nvm.
the node executable is visible with ls:
The text was updated successfully, but these errors were encountered: