Configure Node.js for ExternalEvaluate

Configure your system to evaluate external JavaScript code with Node.js.

Prerequisites

Node.js must first be installed on your system. Installers for all systems are available from https://www.nodejs.org.

The Node.js package manager, npm, is necessary to install the zeromq sockets package for communication with the Node.js evaluator. Refer to Node.js documentation on how to install npm if it is not available with your installation.

Install zeromq

Once Node.js and npm have been installed, the zeromq package can be installed using npm. By default, npm will install the package to a folder named node_modules, but for ExternalEvaluate to find the installation, it needs to be placed in a directory called .node_modules in the home directory.
$ cd ~
$ npm install zeromq
$ mv node_modules .node_modules
On Windows, this is the equivalent command to install zeromq.
> cd %HOME%
> npm.exe install zeromq
> ren node_modules .node_modules

Verify the Installation

Once the installation is successful, FindExternalEvaluators should discover the installation automatically.
In[1]:=
Click for copyable input
Out[1]=

Possible Issues

If you have installed Node.js according to the preceding steps, but it is not discovered by FindExternalEvaluators, you can register it manuallywith RegisterExternalEvaluator, for example.
In[1]:=
Click for copyable input
Out[1]=