Cannot install latest nodejs using conda on Mac
Asked Answered
A

5

26

When I run conda search -c conda-forge nodejs, I get:

# Name                       Version           Build  Channel
...
nodejs                        14.2.0      h2c41780_1  conda-forge
nodejs                        14.2.0      h38d8c5a_0  conda-forge
nodejs                        14.3.0      h2c41780_0  conda-forge
nodejs                        14.4.0      h2c41780_0  conda-forge

But when I try to install it using conda install -c conda-forge nodejs it tries to install 6.13.1. Doing conda install -c conda-forge nodejs==14.4.0 also does not work. It keeps trying to "solve" the environment. Any suggestions on how to fix this?

Athodyd answered 11/6, 2020 at 13:2 Comment(7)
nodejs requires icu>65 but the conda-forge default for icu is icu=64.2. This means that you very likely can't install it with other packages at the moment. You can however install the latest version into a separate environment conda create -n new_env_name nodejs. If that's not an option for you consider raising this as an issue here: github.com/conda-forge/nodejs-feedstock/issuesPickel
@Pickel thanks for this. not sure what icu is but is there any workaround? What about installing a slightly older version? I basically need nodejs >= 10.0.Athodyd
In my environment it's possible to install a 10.x version: conda install "nodejs>=10.0". Maybe it also works for you?Pickel
Actually there is a neat workaround posted in conda-forge gitter channel: conda install nodejs -c conda-forge --repodata-fn=repodata.json will install 13.x. All credits go to Wolf Vollprecht :-)Pickel
Do you want to make this the answer and I'll accept it?Athodyd
I'm fine with a self-answer. In the end credit goes to Wolf :-)Pickel
I had a similar problem when using the extension manager on Jupyterlab to install extensions. conda install "nodejs>=10.0" solved my problem.Manzano
P
49

Currently, the latest version nodejs 14.x requires icu>=65 which is not yet globally available across conda-forge packages. Therefore it can be installed into a new environment with conda create -n new_env_name -c conda-forge nodejs, but most likely will raise package conflicts in existing environments.

conda install node-js -c conda-forge installing the very old version 6.13.1 seems to be a solver problem. conda install nodejs -c conda-forge --repodata-fn=repodata.json will install a more current version: nodejs-13.x.

Alternative workaround is to use mamba as a conda replacement.

Credits go to Wolf Vollprecht.

Pickel answered 13/6, 2020 at 7:58 Comment(4)
Note: conda install nodejs -c conda-forge --repodata-fn=repodata.json installed nodejs 12.4.0 not 13.X. At least on my machine. Anyway, the version is more recent than the ancient 6.X you get with the standard installation, so still enough for me, thanks.Hypoploid
I'm getting this same issue in Ubuntu 20.04 FYI. Seems like something that should be fixed...Ecospecies
same here on debian buster see the answer below https://mcmap.net/q/122112/-cannot-install-latest-nodejs-using-conda-on-mac it solves my problemRivera
Had precisely the same issue on my manjaro installation, conda install nodejs -c conda-forge --repodata-fn=repodata.json did the trickBlondell
S
15

I had a similar problem and this is how I fixed it:

First I did not only conda install -c conda-forge nodejs, but all the commands that are listed in the https://anaconda.org/conda-forge/nodejs.

conda install -c conda-forge nodejs
conda install -c conda-forge/label/gcc7 nodejs
conda install -c conda-forge/label/cf201901 nodejs
conda install -c conda-forge/label/cf202003 nodejs

With this I got 13.10.1 version of nodejs. And after I did conda update nodejs and received 14.8.0 version of it.

Streptomycin answered 3/5, 2021 at 15:37 Comment(2)
conda install -c conda-forge/label/cf202003 nodejs installs 12.4.0Pinfeather
This is correct. The only problem I get with this is that if I try to update all conda packages, then nodejs gets back to version 6...Lotus
J
8

Here's my workaround:

I installed nodejs for Mac from the .pkg file from the offical site and then every time I update packages in my conda environments, I force remove the nodejs version conda installs with:

conda uninstall --force nodejs

and then go about using the environment as if it had nodejs installed. That way when any other package needs nodejs, it gets the latest one from the system directory /usr/local/.

Jornada answered 1/9, 2020 at 0:49 Comment(2)
Seems like conda is causing some severe problems. For me, even conda --info throws an error report. Just uninstalling conda using this answer worked out for me, I was then able to run the homebrew version that I installed earlier.Empurple
Be warned though that forcibly removing nodejs will also remove all its dependent packages. In my case 16 of them, including e.g. jupyterhub, oauthlib, alembic, greenlet, and sqlalchemy to name the more popular ones (installed by conda from its conda-forge channel).Studding
S
7

Just try this:

conda upgrade -c conda-forge nodejs
Seurat answered 16/2, 2022 at 15:46 Comment(0)
H
4

NodeJS 15.3 successfully installed as of today, with:

conda install -c conda-forge nodejs

On a miniconda 4.9.2, python 3.9 environment.

As detail, the icu==68.1 get installed together.

Hold answered 16/12, 2020 at 14:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.