nvm: "No such file or directory" when there is indeed such a file "node"

Operating system and version:

Debian Linux 10.8

nvm debug output:

nvm --version: v0.37.2
$SHELL: /bin/bash
$SHLVL: 1
whoami: 'pi'
${HOME}: /home/pi
${NVM_DIR}: '${HOME}/.config/nvm'
${PATH}: ${NVM_DIR}/versions/node/v12.21.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'GNU bash, version 5.0.3(1)-release (i686-pc-linux-gnu)'
uname -a: 'Linux 4.19.0-13-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux'
checksum binary: 'sha256sum'
OS version: Debian GNU/Linux 10  
curl: /usr/bin/curl, curl 7.64.0 (i686-pc-linux-gnu) libcurl/7.64.0 OpenSSL/1.1.1d zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.36.0 librtmp/2.3
wget: /usr/bin/wget, GNU Wget 1.20.1 built on linux-gnu.
git: /usr/bin/git, git version 2.20.1
grep: /bin/grep (grep --color=auto), grep (GNU grep) 3.3
awk: /usr/bin/awk, awk: not an option: --version
sed: /bin/sed, sed (GNU sed) 4.7
cut: /usr/bin/cut, cut (GNU coreutils) 8.30
basename: /usr/bin/basename, basename (GNU coreutils) 8.30
rm: /bin/rm, rm (GNU coreutils) 8.30
mkdir: /bin/mkdir, mkdir (GNU coreutils) 8.30
xargs: /usr/bin/xargs, xargs (GNU findutils) 4.6.0.225-235f
nvm current: 
which node: ${NVM_DIR}/versions/node/v12.21.0/bin/node
which iojs: 
which npm: ${NVM_DIR}/versions/node/v12.21.0/bin/npm
npm config get prefix: /usr
npm root -g: /usr/lib/node_modules

nvm ls output:

      v12.21.0
         system
default -> 12 (-> v12.21.0)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v12.21.0) (default)
stable -> 12.21 (-> v12.21.0) (default)
lts/* -> lts/fermium (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.0 (-> N/A)
lts/erbium -> v12.21.0
lts/fermium -> v14.16.0 (-> N/A)

How did you install nvm?

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.37.2/install.sh | bash

What steps did you perform?

Checking node --version

What happened?

Got:

bash: /home/pi/.config/nvm/versions/node/v12.21.0/bin/node: No such file or directory

What did you expect to happen?

A node version number, not an error.

Is there anything in any of your profile files that modifies the PATH?

Other than nvm itself, no. My $PATH is: /home/pi/.config/nvm/versions/node/v12.21.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games

The “file not found” doesn’t seem to be about the copy of node itself… it’s definitely there. I can see the node file in the directory at /home/pi/.config/nvm/versions/node/v12.21.0/bin/.

which node also returns /home/pi/.config/nvm/versions/node/v12.21.0/bin/node.

It seems the node is actually running at the command line, but that node itself is producing the “No such file or directory” error for some reason, and what file it isn’t finding, I have no idea.

env node --version works, but it finds the default v10.24.0 version of node.

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 28 (8 by maintainers)

Most upvoted comments

Hmm… It looks like this is already documented in your README.

@Trott please see above, since you explicitly say you are on Alpine. Sounds to me like OP was on Debian, now that I look at the thread in more detail. Apologies for creating further confusion apropos “what platform is this on.”

I don’t have a real solution - but I think I found the cause. Run the following command on your raspberry pi 4:

uname -m

If this shows aarch64 or similar, then nvm also thinks that the raspberry pi is 64 bit, and tries to download the 64 bit version of node. Node’s 32-bit build still works just fine, but for some reason the 64 bit build is failing in this very unusual way.

My only real answer is to download “Linux Binary - ARMv7” from here:

https://nodejs.org/en/download/current/

and place it in the system path. It’s inelegant, but it should work, in thoery.

that’s arm6l, the line of code is armv6l - i’m not familiar with the difference tho.

I could be wrong, but I doubt they are different. ARM is the architecture. 6 is the version of the architecture. l is for little-endian. The inclusion or omission of the v for version before the version number is a matter of style, I think. I don’t think Richard was specifying a string value, just saying the arm6l chips are not supported anymore.

I just had a very similar issue on Alpine and I’m wondering if the problem is that nvm has installed an incompatible binary. I’m not sure which Pi devices/ARM chips are supported by downloadable Node.js binaries and which need to be compiled locally, but that would seem to be something to look into.