Install MariaDB Connector/Node.js

Overview

MariaDB Connector/Node.js is usually installed either from the Node.js repository or manually from the source code package.

Install MariaDB Connector/Node.js via Repository

To install MariaDB Connector/Node.js from the Node.js repository, use NPM:

$ npm install mariadb

NPM connects to the Node.js repository and downloads MariaDB Connector/Node.js and all relevant dependencies into the node_modules/ directory.

Install MariaDB Connector/Node.js via Source Code

To download and install the MariaDB Connector/Node.js manually from source code:

  1. Go to the MariaDB Connector/Node.js download page

  2. Ensure the "Product" dropdown reads "Node.js connector."

  3. In the "Version" dropdown, select the version you want to download.

  4. In the "OS" dropdown, select either "Platform independent (tar)" or "Platform independent (zip)", depending on whether you need a zip or tar archive.

  5. Click the "Download" button to download the source code package.

  6. When the source code package finishes downloading, install it with NPM:

    $ npm install mariadb-connector-nodejs-*.tar.gz
    

NPM untars the download and installs MariaDB Connector/Node.js in the node_modules/ directory.