Installing Node.js

The Curvenote Command Line Interface (CLI) is built on Node.js (nodejs), a JavaScript runtime that is widely used in many projects including well-known Python projects such as Jupyter Lab. node comes with its own package manager called npm.

There are a number of ways to install nodejs and you can choose one that is suitable depending on your platform and preferences.

Node Versions

The Curvenote CLI needs Node.js 20.19 or later in the 20 line, 22.12 or later in the 22 line, or 24. Odd-numbered releases of Node.js are not long-lived, so prefer an even-numbered release.

Following any of the install methods below, verify your installation and ensure that node and npm are available on your system PATH by opening a new terminal window or command line prompt and typing:

% node -v
v22.12.0
% npm -v
11.3.0

Manual Installation (all platforms)

You can download an appropriate installer package for your platform by visiting https://nodejs.org/. LTS refers to the current Long Term Support version of nodejs and is the best choice for use with Curvenote.

Download the installer package, and follow instructions to execute the installer for your platform. The installer will automatically add node and npm to your system PATH.

🛠️ Next, install Curvenote.

node via conda / mamba (all platforms)

nodejs is available as a package on conda-forge, although a limited number of versions are available on that channel. If you are a conda user, installation is straightforward but please note that the CLI needs one of the versions above, and conda-forge also carries odd-numbered releases.

🛠️ Use the following command to lock down the version you are installing, adjust as necessary for the even-numbered version you are targeting:

(my-conda-env)% conda install -c conda-forge 'nodejs>=22,<23'
(my-conda-env)% node -v
(my-conda-env)% v22.12.0
(my-conda-env)% npm -v
(my-conda-env)% 10.9.0

💡 Alternatively, you can create a new conda environment directly as a node environment:

% conda create -yn my-node-env 'nodejs>=22,<23'
% ....
#
# To activate this environment, use
#
#     $ conda activate my-node-env
#
# To deactivate an active environment, use
#
#     $ conda deactivate

🛠️ Next, install Curvenote.

nodeenv via pip (all platforms)

nodeenv is a python package allowing you to create and manage node installations on your system via virtual environments. If you want to work in virtual environments for node alongside your python virtualenv this is the way to go.

🛠️ Install nodeenv:

% pip install nodeenv

🛠️ Query available node versions:

% nodeenv --list
% ... 22.12.0 ...

🛠️ Create a new environment based on a specific node version, and activate it:

% nodeenv -n 22.12.0 node_env
% . node_env/bin/activate
(node_env) % node -v
(node_env) % v22.12.0
(node_env) % npm -v
(node_env) % 10.9.0

Read more about nodeenv in their docs.

🛠️ Next, install Curvenote.

Node Version Manager - Linux/MacOS (nvm)

nvm is a convenient way to manage multiple node installations on a POSIX compatible system.

🛠️ Install nvm using the install script in their docs.

% nvm -v
0.39.1

💡 Note: on MacOS you can also install nvm via brew

🛠️ Next, install an initial (default) version of node:

% nvm install 22
Downloading and installing node v22...
...
Now using node v22 (npm v10)
%

🛠️ Next, install Curvenote.

Abbreviations
CLI
Command Line Interface