Install MariaDB Connector/Node.js

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 Connectors download page:

  2. In the "Product" drop-down, select the Node.js connector.

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

  4. 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.