Enmap Installation

Installing enmap

In order to install Enmap, you'll need a few things installed on your machine. First off, you need NodeJS (Node 10 is required. Not 8, not 9, not 12. NODE 10 ONLY). For Windows and MacOS, simply download and install from the website. For Linux, see this page for installation.

To install Enmap in your project, all you need to do is run the following command:

npm i enmap@latest

This may take a few minutes, then you're ready to use it.

Peer Dependencies

For persistence you need to also install better-sqlite-pool, which is necessary for the sqlite database interaction.

Pre-Requisites

better-sqlite-pool has a specific pre-requisite which is needed to build it. How to install these depends on your operating system, so see below for instructions:

On Windows, two things are required to install enmap-sqlite. Python 2.7 and the Visual Studio C++ Build Tools. They are required for any module that is built on the system, which includes sqlite.

The Windows Build Tools require over 3GB of space to install and use. Make sure you have enough space before starting this download and install!

To install the necessary pre-requisites on Windows, the easiest is to simply run the following command, under an administrative command prompt or powershell:

npm i -g --add-python-to-path --vs2015 --production windows-build-tools

It's very important that this be run in the administrative prompt, and not a regular one.

Once the windows-build-tools are installed (this might take quite some time, depending on your internet connection), close all open command prompts, powershell windows, and editors with a built-in console/prompt. Otherwise, the next command will not work.

Once those pre-requisites are installed, simply run the following command:

npm i better-sqlite-pool

This will take a few minutes also, as it needs to build the module from source code.

Dernière mise à jour