nvm icon indicating copy to clipboard operation
nvm copied to clipboard

not able to install node 14 with nvm

Open Vishnu94833 opened this issue 1 year ago • 17 comments

Operating system and version:

nvm debug output:

nvm --version: v0.39.7
$TERM_PROGRAM: Apple_Terminal
$SHELL: /bin/zsh
$SHLVL: 1
whoami: 'vkuppan'
${HOME}: /Users/vkuppan
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: ${NVM_DIR}/versions/node/v20.11.0/bin:${HOME}/.volta/bin:${HOME}/google-cloud-sdk/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/3.12/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.9 (x86_64-apple-darwin23.0)'
uname -a: 'Darwin 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:55:06 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6020 arm64'
checksum binary: 'shasum'
OS version: macOS 14.2.1 23C71
awk: /usr/bin/awk, awk version 20200816
curl: /usr/bin/curl, curl 8.4.0 (x86_64-apple-darwin23.0) libcurl/8.4.0 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.55.1
wget: not found
sed: /usr/bin/sed
cut: /usr/bin/cut
basename: /usr/bin/basename
rm: /bin/rm
mkdir: /bin/mkdir
xargs: /usr/bin/xargs
git: /opt/homebrew/bin/git, git version 2.43.0
grep: /usr/bin/grep, grep (BSD grep, GNU compatible) 2.6.0-FreeBSD
nvm current: v20.11.0
which node: ${NVM_DIR}/versions/node/v20.11.0/bin/node
which iojs: iojs not found
which npm: ${NVM_DIR}/versions/node/v20.11.0/bin/npm
npm config get prefix: ${NVM_DIR}/versions/node/v20.11.0
npm root -g: ${NVM_DIR}/versions/node/v20.11.0/lib/node_modules

nvm ls output:

v14.15.5
       v16.20.2
       v18.19.0
->     v20.11.0
         system
default -> 20 (-> v20.11.0)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v20.11.0) (default)
stable -> 20.11 (-> v20.11.0) (default)
lts/* -> lts/iron (-> v20.11.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.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.21.3 (-> N/A)
lts/gallium -> v16.20.2
lts/hydrogen -> v18.19.0
lts/iron -> v20.11.0

How did you install nvm?

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

What steps did you perform?

nvm install 14

What happened?

image

What did you expect to happen?

I wanted Node version 14.21.3

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

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

If you are having installation issues, or getting "N/A", what does curl -I --compressed -v https://nodejs.org/dist/ print out?


Vishnu94833 avatar Feb 09 '24 08:02 Vishnu94833

Where's the nvm debug output? The issue template is there for a reason, please fill it out in its entirety.

ljharb avatar Feb 09 '24 11:02 ljharb

I have the same problem, can you help?

raylancordeiro avatar Feb 09 '24 19:02 raylancordeiro

@raylancordeiro please provide everything the issue template asks for

ljharb avatar Feb 09 '24 19:02 ljharb

@ljharb if you pay attention, @Vishnu94833 already shared the npm debug logs at the opening of the issue. Do you need more information?

lucastorress avatar Feb 09 '24 20:02 lucastorress

@lucastorress if you pay attention, you’ll notice that those were edited in after i asked, and then the OP didn’t comment to notify me that it was there.

We have a code of conduct and that kind of hostile response won’t be tolerated.

ljharb avatar Feb 09 '24 20:02 ljharb

@ljharb Don't get me wrong, I also found your response hostile at first, but the idea here is to understand and help.

The problem here on my machine is the same as reported by @Vishnu94833, the same version and the same operating system. This only happens in NodeJS version 14, with command nvm install 14.

I took a look at another issue, which indicates downgrading the version to 0.39.1, as 0.39.7 has this error.

Temporary solution found here: https://github.com/nvm-sh/nvm/issues/3148#issuecomment-1881408472

lucastorress avatar Feb 09 '24 20:02 lucastorress

What the error message shows is that it's requiring an older version of python than you have on your system. I have no idea why downgrading nvm would have any impact on that.

ljharb avatar Feb 09 '24 21:02 ljharb

@ljharb , Thanks for the suggestion. but I want the latest version of Python as another dependency for Kubectl. Downgrading to an older version is clearly mentioned in the logs that I can see. I just wanted to know if there's a fix for my problem.

I forgot to mention you once I edited the template. I thought you'd be notified.

Thanks!

Vishnu94833 avatar Feb 10 '24 02:02 Vishnu94833

It's not really an option; the python version required to build node is determined by node, and that's the only way to get it to work.

ljharb avatar Feb 10 '24 05:02 ljharb

If you have installed nvm using homebrew, then remove it

brew uninstall nvm

also

rm -rf $NVM_DIR

then install nvm 0.39.1 using the script and then install nvm install 14, it works. I had the same issue and managed to fix that using this version.

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

bickky-sahani avatar Feb 14 '24 06:02 bickky-sahani

Worked flawlessly with v0.39.1 - I've had this same issue with a few other versions too, I guess I'll keep using 0.39.1 for a good while in the future while I still need node v14

matheustavaresdev avatar Mar 07 '24 00:03 matheustavaresdev

Lots of things won't work properly if you're on anything but the latest, so 0.39.1 isn't a great choice. Be on 0.39.7, and provide the info requested in the issue template, so I can fix it. I don't know what would be different in those versions that would make node 14 uninstallable, and I can install node 14 just fine on latest nvm.

ljharb avatar Mar 07 '24 06:03 ljharb

... I want the latest version of Python as another dependency for Kubectl. Downgrading to an older version is clearly mentioned in the logs that I can see. I just wanted to know if there's a fix for my problem.

What if you run brew unlink first to restore the default python from macOS, then install node 14, and at last brew link latest python again?

brew link [email protected], puts 'python3.10' in your path but it doesn't make python3 reference the 3.10 version. I saw a thread from one of the homebrew developers who said they support alternate python versions with e.g.:

export PATH="$(/opt/homebrew/bin/brew --prefix [email protected])/libexec/bin:$PATH"

(different path to brew if you're on Intel)

Doing this meant nvm install 14.20.0 completed without error (dependent on xcode-tools version which I raised in a different rejected bug report), and felt cleaner than using pyenv to achieve the same thing. As a bonus doing that makes also python resolve to python3 which is needed for certain other commands to work.

It would avoid a lot of issues if the node developers simply provided an ARM binary for Darwin on Node 14.20.0, but I guess that's not going to happen now.

Slightly off-topic: Does anyone know how I can create my own version of https://nodejs.org/dist/v14.20.0/ with my own node-v14.20.0-darwin-arm64.tar.gz with and get nvm to use it? It looks like it's signed. Then I'd only have to go through this once, upload the built binary somewhere and not need the above hacks when setting up a new machine.

keeely avatar Mar 10 '24 13:03 keeely

@keeely you can host it somewhere and set the nodejs.org mirror env var to point to it, and nvm will look there instead.

ljharb avatar Mar 10 '24 15:03 ljharb

@keeely you can host it somewhere and set the nodejs.org mirror env var to point to it, and nvm will look there instead.

Thanks! Yes, index.tab is needed, and then just the file in the right directory.

├── index.tab
└── v14.20.0
    └── node-v14.20.0-darwin-arm64.tar.xz

It gives a warning about the missing checksum but then goes on to install it.

$ NVM_NODEJS_ORG_MIRROR=http://localhost:8081 nvm install v14.20.0
Downloading and installing node v14.20.0...
Downloading http://localhost:8081/v14.20.0/node-v14.20.0-darwin-arm64.tar.xz...
######################################################################################################################################################## 100.0%
Computing checksum with sha256sum
Provided checksum to compare to is empty.

keeely avatar Mar 10 '24 22:03 keeely

You should provide the checksum in the index.tab file :-) then there won't be a warning.

ljharb avatar Mar 10 '24 22:03 ljharb

If you're looking for a precompiled link, you might find https://nodejs.raccoon-tw.dev/ useful

NVM_NODEJS_ORG_MIRROR=https://nodejs.raccoon-tw.dev/release nvm install v14.21.3

milomg avatar Mar 21 '24 22:03 milomg

This helped https://stackoverflow.com/a/67254340

ZaidPathan avatar Jul 17 '24 11:07 ZaidPathan