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

not able to install node 14 with nvm #3284

Open
Vishnu94833 opened this issue Feb 9, 2024 · 17 comments
Open

not able to install node 14 with nvm #3284

Vishnu94833 opened this issue Feb 9, 2024 · 17 comments
Labels
installing node Issues with installing node/io.js versions. needs followup We need some info or action from whoever filed this issue/PR.

Comments

@Vishnu94833
Copy link

Vishnu94833 commented Feb 9, 2024

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?

@ljharb
Copy link
Member

ljharb commented Feb 9, 2024

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

@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. labels Feb 9, 2024
@raylancordeiro
Copy link

I have the same problem, can you help?

@ljharb
Copy link
Member

ljharb commented Feb 9, 2024

@raylancordeiro please provide everything the issue template asks for

@lucastorress
Copy link

lucastorress commented Feb 9, 2024

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

@ljharb
Copy link
Member

ljharb commented Feb 9, 2024

@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.

@lucastorress
Copy link

@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: #3148 (comment)

@ljharb
Copy link
Member

ljharb commented Feb 9, 2024

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.

@Vishnu94833
Copy link
Author

Vishnu94833 commented Feb 10, 2024

@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!

@ljharb
Copy link
Member

ljharb commented Feb 10, 2024

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.

@bickky-sahani
Copy link

bickky-sahani commented Feb 14, 2024

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

@matheustavaresdev
Copy link

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

@ljharb
Copy link
Member

ljharb commented Mar 7, 2024

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.

@keeely
Copy link

keeely commented Mar 10, 2024

... 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.

@ljharb
Copy link
Member

ljharb commented Mar 10, 2024

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

@keeely
Copy link

keeely commented Mar 10, 2024

@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.

@ljharb
Copy link
Member

ljharb commented Mar 10, 2024

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

@modderme123
Copy link

modderme123 commented Mar 21, 2024

In case it's helpful, here's a precompiled binary for node 14.21.3 on M1 https://github.com/modderme123/node14-arm (I compiled this one using nix)

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.
Projects
None yet
Development

No branches or pull requests

8 participants