25

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?

cel
  • 30,017
  • 18
  • 97
  • 117
K G
  • 1,715
  • 6
  • 21
  • 29
  • 1
    nodejs requires [icu>65](https://github.com/conda-forge/nodejs-feedstock/blob/master/recipe/meta.yaml#L36) but the conda-forge default for icu is [icu=64.2](https://github.com/conda-forge/conda-forge-pinning-feedstock/blob/master/recipe/conda_build_config.yaml#L420). 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: https://github.com/conda-forge/nodejs-feedstock/issues – cel Jun 11 '20 at 13:44
  • 2
    @cel 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. – K G Jun 11 '20 at 13:46
  • 4
    In my environment it's possible to install a 10.x version: `conda install "nodejs>=10.0"`. Maybe it also works for you? – cel Jun 11 '20 at 13:50
  • 4
    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 :-) – cel Jun 11 '20 at 14:22
  • Do you want to make this the answer and I'll accept it? – K G Jun 11 '20 at 14:22
  • I'm fine with a self-answer. In the end credit goes to Wolf :-) – cel Jun 11 '20 at 14:28
  • I had a similar problem when using the extension manager on Jupyterlab to install extensions. `conda install "nodejs>=10.0"` solved my problem. – Jason Jul 10 '20 at 05:51

5 Answers5

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.

cel
  • 30,017
  • 18
  • 97
  • 117
  • 5
    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. – muuh Nov 21 '20 at 10:26
  • I'm getting this same issue in Ubuntu 20.04 FYI. Seems like something that should be fixed... – Guillochon Mar 16 '21 at 18:40
  • same here on debian buster see the answer below https://stackoverflow.com/a/67371745/4775727 it solves my problem – 4x10m May 09 '21 at 19:42
  • Had precisely the same issue on my manjaro installation, `conda install nodejs -c conda-forge --repodata-fn=repodata.json` did the trick – ronimb Jan 08 '23 at 10:48
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.

  • conda install -c conda-forge/label/cf202003 nodejs installs 12.4.0 – Ege Jun 02 '21 at 20:45
  • 1
    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... – muammar Jul 22 '21 at 15:44
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/.

Geoffrey Simms
  • 209
  • 2
  • 4
  • 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. – Ébe Isaac Dec 07 '20 at 07:13
  • 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). – mirekphd Aug 25 '23 at 17:03
6

Just try this:

conda upgrade -c conda-forge nodejs
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.

Vincenzo Lavorini
  • 1,884
  • 2
  • 15
  • 26