LogoLogo
GitHubNPMDiscord Support
5.x
5.x
  • What is Enmap?
  • Enmap Installation
    • Troubleshooting Guide
    • Migrating data from Enmap 3
  • Usage Documentation
    • Basic Data Use
    • Understanding Paths
    • Working with Objects
    • Array Methods
    • Mathematical Methods
    • Using the fetchAll option
    • Using from multiple files
    • Serializing and Deserializing
  • Full Documentation
  • Examples
    • D.js Points/Currency
    • D.js Per-Server Settings
    • D.js Mod Logs
    • Koa Authentication
  • Blog Posts
    • Enmap's History
    • Why SQLITE only?
    • Enmap and Josh
  • Supporters and Partners
Powered by GitBook
On this page
  • Pre-Requisites
  • Installing Enmap
Export as PDF

Enmap Installation

To install Enmap, please read these instructions very carefully, every word is important!

PreviousWhat is Enmap?NextTroubleshooting Guide

Last updated 3 years ago

Enmap is a wrapper around better-sqlite3, which requires to be built directly on your system. As such, you need to install pre-requisites first. Please follow these instructions to the letter. If it's not written here, you probably shouldn't do it unless you know why you're doing it.

Pre-Requisites

SQLite modules usually only successfully work on LTS versions of node. This means it will work correctly on node 12, and 14. It will not work on node 13, 15, 17. Make sure you have the right version, check this with node -v.

Also, better-sqlite3 doesn't compile on unreleased node versions usually. Your mileage may vary, but don't expect it to work on the "Latest" version of node either.

How to install the pre-requisites depends on your operating system, so see below for instructions:

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

To install the necessary prerequisites on Windows, the easiest is to simply run the following commands separately, under an administrative command prompt or powershell:

// First run:
npm i -g --add-python-to-path --vs2015 --production windows-build-tools

// Then run:
npm i -g node-gyp@latest

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.

On Linux, the pre-requisites are much simpler in a way. A lot of modern systems (such as Ubuntu, since 16.04) already come with python 2.7 pre-installed. For some other systems, you might have to fiddle with it to either get python 2.7 installed, or to install both 2.7 and 3.x simultaneously. Google will be your friend.

As for the C++ build tools, that's installed using the simple command: sudo apt-get install build-essential for most debian-based systems. For others, look towards your package manager and specificall "GCC build tools". Your mileage may vary but hey, you're using Linux, you should know this stuff.

As of writing this page, MacOS versions seem to all come pre-built with Python 2.7 on the system. You will, however, need the C++ build tools.

  • Install

  • Once XCode is installed, go to Preferences, Downloads, and install the Command Line Tools.

Once installed, you're ready to continue.

Installing Enmap

Once those pre-requisites are installed (if they're not, scroll up, and follow the instructions), and you've closed all open command prompts, open a new, normal (not-admin) command prompt or terminal in your project, then install Enmap using the following command:

npm i enmap

This will take a few minutes, as it needs to build better-sqlite3 from source code, and then install enmap itself. Note that "a few minutes" can be 1 or 30 minutes, it really depends on your hardware and configuration.

If you get any errors, please see the . If the guide doesn't help, join the Discord (link at the top of this page).

XCode
Troubleshooting Guide