Closed ct24p closed 1 week ago
What's the output of nvm debug
?
nvm --version: v0.40.1 $SHELL: /bin/bash $SHLVL: 1 whoami: 'ec2-user' ${HOME}: /home/ec2-user ${NVM_DIR}: '${HOME}/.nvm' ${PATH}: ${NVM_DIR}/versions/node/v20.17.0/bin:${HOME}/.local/bin:${HOME}/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin $PREFIX: '' ${NPM_CONFIG_PREFIX}: '' $NVM_NODEJS_ORG_MIRROR: '' $NVM_IOJS_ORG_MIRROR: '' shell version: 'GNU bash, version 4.4.20(1)-release (x86_64-redhat-linux-gnu)' uname -a: 'Linux 4.18.0-553.5.1.el8_10.x86_64 #1 SMP Thu Jun 6 09:41:19 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux' checksum binary: 'sha256sum' OS version: ****WARNING****WARNING*WARNING*** awk: /usr/bin/awk, GNU Awk 4.2.1, API: 2.0 (GNU MPFR 3.1.6-p2, GNU MP 6.1.2) curl: /usr/bin/curl, curl 7.61.1 (x86_64-redhat-linux-gnu) libcurl/7.61.1 OpenSSL/1.1.1k zlib/1.2.11 brotli/1.0.6 libidn2/2.2.0 libpsl/0.20.2 (+libidn2/2.2.0) libssh/0.9.6/openssl/zlib nghttp2/1.33.0 wget: not found git: not found ls: cannot access 'alias'$'\n''/usr/bin/grep': No such file or directory grep: alias grep='grep --color=auto' /usr/bin/grep (grep --color=auto), grep (GNU grep) 3.1 sed: /usr/bin/sed, sed (GNU sed) 4.5 cut: /usr/bin/cut, cut (GNU coreutils) 8.30 basename: /usr/bin/basename, basename (GNU coreutils) 8.30 rm: /usr/bin/rm, rm (GNU coreutils) 8.30 mkdir: /usr/bin/mkdir, mkdir (GNU coreutils) 8.30 xargs: /usr/bin/xargs, xargs (GNU findutils) 4.6.0 nvm current: none which node: ${NVM_DIR}/versions/node/v20.17.0/bin/node which iojs: /usr/bin/which: no iojs in (${NVM_DIR}/versions/node/v20.17.0/bin:${HOME}/.local/bin:${HOME}/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin) which npm: ${NVM_DIR}/versions/node/v20.17.0/bin/npm npm config get prefix: -bash: ${NVM_DIR}/versions/node/v20.17.0/bin/npm: /usr/bin/env: bad interpreter: Operation not permitted npm root -g: -bash: ${NVM_DIR}/versions/node/v20.17.0/bin/npm: /usr/bin/env: bad interpreter: Operation not permitted
BTW: if git is installed (git version 2.43.5) before nvm installation, install nvm will got error below:
=> Cloning into '/home/ec2-user/.nvm'... fatal: cannot copy '/usr/share/git-core/templates/hooks/fsmonitor-watchman.sample' to '/home/ec2-user/.nvm/.git/hooks/fsmonitor-watchman.sample': Operation not permitted Failed to clone nvm repo. Please report this!
Googling suggests this is a common Mac OS error, or https://chipcullen.com/fixing-bad-interpreter-error-aws-python-3_7/ - but either way I'm not sure how I can debug it from here.
What happens if you chmod a+x /home/ec2-user/.nvm/versions/node/v20.10.0/bin/node
?
thanks for your helps. it's 700, i tried to chmod to 777/755, same error, Not MacOS, it's AWS Rocky 8.9 AMI. However, if i run: `sudo /home/ec2-user/.nvm/versions/node/v20.10.0/bin/node -v', it printed v20.17.0 (correct). The installation was under non-root user.
Assuming that nvm is installed under ec2-user, can you run other things you install as ec2-user? or does AWS only let you run your own programs as root?
@ljharb: Thanks very much for the helps. I finally figured it out that the issue was caused by fapolicyd, Without updating or remove it, all chmod commands have no effects at all in Rocky linux.
Operating system and version:
AWS EC2 Rocky 8.9
nvm debug
output:nvm ls
output:How did you install
nvm
?What steps did you perform?
What happened?
What did you expect to happen?
node -v
should showv20.17.0
Is there anything in any of your profile files that modifies the
PATH
?.bashrc