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

/usr/bin/env: ‘node’: No such file or directory on Raspbian 64-bit #2233

Open
nielsriekert opened this issue Jun 6, 2020 · 8 comments
Open
Labels
installing node Issues with installing node/io.js versions. needs followup We need some info or action from whoever filed this issue/PR. OS: Raspberry Pi

Comments

@nielsriekert
Copy link

Operating system and version:

Operating System: Raspbian GNU/Linux 10 (buster)
Kernel: Linux 4.19.118-v8+
Architecture: arm64

nvm debug output:

$SHELL: /bin/bash
$SHLVL: 1
${HOME}: /home/niels
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: ${NVM_DIR}/versions/node/v12.18.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 (arm-unknown-linux-gnueabihf)'
uname -a: 'Linux 4.19.118-v8+ #1311 SMP PREEMPT Mon Apr 27 14:32:38 BST 2020 aarch64 GNU/Linux'
OS version: Raspbian GNU/Linux 10
curl: /usr/bin/curl, curl 7.64.0 (arm-unknown-linux-gnueabihf) 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-gnueabihf.
git: not found
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.18.0/bin/node
which iojs:
which npm: ${NVM_DIR}/versions/node/v12.18.0/bin/npm
npm config get prefix: /usr/bin/env: ‘node’: No such file or directory
npm root -g: /usr/bin/env: ‘node’: No such file or directory

nvm ls output:

       v12.18.0
default -> node (-> v12.18.0)
node -> stable (-> v12.18.0) (default)
stable -> 12.18 (-> v12.18.0) (default)
iojs -> N/A (default)
unstable -> N/A (default)
lts/* -> lts/erbium (-> v12.18.0)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.21.0 (-> N/A)
lts/erbium -> v12.18.0

How did you install nvm?

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

What steps did you perform?

Clean install of Raspbian Lite with arm_64bit=1 added to config.txt (info).
When disabling arm_64bit there are no errors btw.

What happened?

Error after installing --lts or any other version with nvm install --lts.

/usr/bin/env: ‘node’: No such file or directory
nvm is not compatible with the npm config "prefix" option: currently set to ""
Run `nvm use --delete-prefix v12.18.0` to unset it.

What did you expect to happen?

No error and node and npm command available in shell. After running nvm use --delete-prefix v12.18.0 and using node command:

-bash: /home/niels/.nvm/versions/node/v12.18.0/bin/node: No such file or directory

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

No

@ljharb
Copy link
Member

ljharb commented Jun 6, 2020

is $HOME a symlink by any chance?

does /home/niels/.nvm/versions/node/v12.18.0/bin/node exist on your system?

When you install node with arm_64bit enabled, does it download a binary or does it compile the source?

@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. OS: Raspberry Pi labels Jun 6, 2020
@nielsriekert
Copy link
Author

Do you know enough with this snippet?

$ $HOME
-bash: /home/niels: Is a directory

/home/niels/.nvm/versions/node/v12.18.0/bin/node exists

~/.nvm/versions/node/v12.18.0/bin $ ls -l
total 46040
-rwxr-xr-x 1 niels niels 47141688 Jun  2 16:36 node
lrwxrwxrwx 1 niels niels       38 Jun  2 16:36 npm -> ../lib/node_modules/npm/bin/npm-cli.js
lrwxrwxrwx 1 niels niels       38 Jun  2 16:36 npx -> ../lib/node_modules/npm/bin/npx-cli.js

It looks like it downloads the binary:

$ nvm install --lts
Installing latest LTS version.
Downloading and installing node v12.18.0...
Downloading https://nodejs.org/dist/v12.18.0/node-v12.18.0-linux-arm64.tar.xz...
########################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
/usr/bin/env: ‘node’: No such file or directory
nvm is not compatible with the npm config "prefix" option: currently set to ""
Run `nvm use --delete-prefix v12.18.0` to unset it.

@ljharb
Copy link
Member

ljharb commented Jun 7, 2020

I'm very confused.

With that arm bit enabled, if you download the source directly from node's website and compile it, does it work? I'm wondering if node just doesn't function on that setup, unrelated to nvm.

@ArGJolan
Copy link

ArGJolan commented Aug 8, 2020

Edit: Sorry for misinformation, I'm apparently running on 64-bit.

Can reproduce on Raspbian 32-bit 64-bit Full installed with Berryboot.

I also tried following these steps to install nvm. Gives the same error.

node seems to work fine when installed through package manager.

$HOME is not a symlink.

[11:04] [pi@raspberrypi] ~ $ file $HOME
/home/pi: directory
[11:04] [pi@raspberrypi] ~ $ file /home
/home: directory

@tonyneel923
Copy link

I get this exact error on Debian

@ljharb
Copy link
Member

ljharb commented Nov 5, 2020

@ArGJolan node is not distributed through any package manager; what happens if you manually download and compile it off of node’s website?

@tonyneel923 can you file a new issue and fill out the issue template?

@xairoo
Copy link

xairoo commented Jan 24, 2021

nvm install -s <version> finally worked.
But it's the 32 bit version.

nvm install <version>:

pi@server04:~ $ /usr/local/lib/nodejs/node-v14.15.4-linux-arm64/bin/node
-bash: /usr/local/lib/nodejs/node-v14.15.4-linux-arm64/bin/node: No such file or directory

pi@server04:~ $ file /usr/local/lib/nodejs/node-v14.15.4-linux-arm64/bin/node
/usr/local/lib/nodejs/node-v14.15.4-linux-arm64/bin/node: ELF 64-bit LSB executable, ARM aarch64, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=6ea9394b7835288144fb165747fd82d35262cb94, with debug_info, not stripped

nvm install -s <version>:

pi@server04:~ $ file /home/pi/.nvm/versions/node/v14.15.4/bin/node
/home/pi/.nvm/versions/node/v14.15.4/bin/node: ELF 32-bit LSB executable, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=f5d421575e623134d37172818ce83c7fb680ee1b, with debug_info, not stripped

@Botspot
Copy link
Contributor

Botspot commented Mar 22, 2021

I had the exact same issue, but on 32bit Raspberry Pi OS. Turns out it was use to using the 64-bit kernel. PR #2469 should fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installing node Issues with installing node/io.js versions. needs followup We need some info or action from whoever filed this issue/PR. OS: Raspberry Pi
Projects
None yet
Development

No branches or pull requests

6 participants