Skip to content

docs: update troubleshooting instructions for node-gyp errors #1374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ If `better-sqlite3` refuses to install, follow these guidelines:

- Make sure you're using a [supported version of Node.js](https://nodejs.org/en/about/previous-releases). `better-sqlite3` is only tested with currently-supported versions of Node.js.

## Encountering a `node-gyp` error report

This error may occur when the pre-built file cannot be obtained properly.
To bypass the post-installation script, run the following command first:

```
npm install better-sqlite3 --ignore-scripts
```

Then, navigate to the [Releases](https://github.com/WiseLibs/better-sqlite3/releases/) page to download the corresponding version.
After downloading, place the file in the following location:
`node_modules/better-sqlite3/build/Release/better_sqlite3.node`

## "Install the necessary tools"

- If you're on Windows, during installation of Node.js, be sure to select "Automatically install the necessary tools" from the "Tools for Native Modules" page.
Expand Down