Skip to content

fix: Windows compatibility improvements (sqlite driver & npm scripts) - #95

Open
RiH-137 wants to merge 2 commits into
CypherCommons:mainfrom
RiH-137:fix/cross-platform-scripts
Open

fix: Windows compatibility improvements (sqlite driver & npm scripts)#95
RiH-137 wants to merge 2 commits into
CypherCommons:mainfrom
RiH-137:fix/cross-platform-scripts

Conversation

@RiH-137

@RiH-137 RiH-137 commented Feb 6, 2026

Copy link
Copy Markdown
  1. Replaced sqlite3 with better-sqlite3: Swapped the database driver in [package.json] and updated the TypeOrm configuration in [app.module.ts]. This resolves node-gyp native build failures on Windows by removing the dependency on Visual Studio C++ build tools.

  2. Cross-Platform Scripts: Added [cross-env] as a dev dependency and updated the start:dev, , and test:e2e scripts in [package.json]. This ensures environment variables like [NODE_ENV] are set correctly regardless of the operating system (fixing the ['NODE_ENV' is not recognized].

Simplified Setup: Windows developers can now install and run the project immediately (npm install && npm run start:dev) without needing to install Python or C++ compilers.
Platform Independence: The development scripts now work consistently across Windows, Linux, and macOS.

Copilot AI review requested due to automatic review settings February 6, 2026 18:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves Windows/cross-platform developer experience by adjusting Node dependencies and npm scripts intended to reduce native build friction and make NODE_ENV setting portable.

Changes:

  • Updated dev scripts to use cross-env for setting NODE_ENV on Windows/Linux/macOS.
  • Swapped the SQLite driver dependency from sqlite3 to better-sqlite3.
  • Updated README prerequisites note regarding Node versions / install issues.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
package.json Uses cross-env in scripts; replaces sqlite3 with better-sqlite3; adds a Windows-specific dev script entry.
README.md Adds/updates installation notes and Node version recommendations related to SQLite native builds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
"nest-winston": "^1.10.2",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.2.0",
"secp256k1": "^5.0.1",

Copilot AI Feb 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR removes sqlite3 from dependencies but the app is still configured with TypeORM type: 'sqlite' (which loads the sqlite3 driver). Without updating the TypeORM connection type/driver to better-sqlite3, the app will fail to boot at runtime due to the missing driver.

Suggested change
"secp256k1": "^5.0.1",
"secp256k1": "^5.0.1",
"sqlite3": "^5.1.7",

Copilot uses AI. Check for mistakes.
Comment thread package.json
Comment on lines 48 to 77
@@ -72,6 +73,7 @@
"bitcoinjs-lib": "^6.1.6-rc.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"cross-env": "^10.1.0",
"dockerode": "^4.0.2",

Copilot AI Feb 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package.json changes dependencies (sqlite3 removed, better-sqlite3/cross-env added), but package-lock.json still contains sqlite3 and does not include cross-env/better-sqlite3 as top-level installed packages. Please update and commit the lockfile to keep installs reproducible (especially for Windows).

Copilot uses AI. Check for mistakes.
Comment thread README.md
Comment on lines +57 to 62
> **Note:** If you encounter `gyp` or `sqlite3` build errors, please check your Node.js version. Proceeding with Node.js v18 or v20 LTS is recommended to use prebuilt binaries.

### :notebook: Prerequisites

- Node.js
- Node.js (v18 or v20 LTS recommended. Newer versions like v22 may fail to install `sqlite3` without C++ build tools)
- Docker (optional)

Copilot AI Feb 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README still references sqlite3 install/build issues (and warns that Node v22 may fail to install sqlite3). Since the PR switches the driver to better-sqlite3, these notes are now inaccurate/misleading; update the wording to reference better-sqlite3 (or native addons generally) and the supported Node versions accordingly.

Copilot uses AI. Check for mistakes.
Comment thread package.json
"start:dev": "cross-env NODE_ENV=dev nest start --watch",
"start:debug": "cross-env NODE_ENV=dev nest start --debug --watch",
"start:devWin": "cross-env NODE_ENV=dev nest start --watch",
"start:e2e": "NODE_ENV=e2e nest start",

Copilot AI Feb 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

start:e2e still sets NODE_ENV using POSIX syntax (NODE_ENV=...), which will fail on Windows. Switch it to cross-env NODE_ENV=e2e ... (consistent with start:dev/test:e2e) or otherwise make it cross-platform.

Suggested change
"start:e2e": "NODE_ENV=e2e nest start",
"start:e2e": "cross-env NODE_ENV=e2e nest start",

Copilot uses AI. Check for mistakes.
Comment thread package.json
"start:debug": "NODE_ENV=dev nest start --debug --watch",
"start:dev": "cross-env NODE_ENV=dev nest start --watch",
"start:debug": "cross-env NODE_ENV=dev nest start --debug --watch",
"start:devWin": "cross-env NODE_ENV=dev nest start --watch",

Copilot AI Feb 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

start:devWin is now identical to start:dev (which is already cross-platform via cross-env). Keeping both adds maintenance surface and can confuse which script to use; consider removing start:devWin or making it an alias that calls npm run start:dev.

Suggested change
"start:devWin": "cross-env NODE_ENV=dev nest start --watch",
"start:devWin": "npm run start:dev",

Copilot uses AI. Check for mistakes.
Comment thread package.json
Comment on lines +48 to 55
"better-sqlite3": "^11.0.0",
"currency.js": "^2.0.4",
"js-yaml": "^4.1.0",
"nest-winston": "^1.10.2",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.2.0",
"secp256k1": "^5.0.1",
"sqlite3": "^5.1.7",
"typeorm": "^0.3.20",

Copilot AI Feb 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better-sqlite3 is pinned to ^11.0.0, but the repo is on TypeORM 0.3.20 which declares a peer dependency range for better-sqlite3 of ^7.1.2 || ^8.0.0 || ^9.0.0 (see package-lock). This mismatch can cause npm peer-dep failures/warnings and potential runtime incompatibilities; align the better-sqlite3 version to TypeORM's supported range or upgrade TypeORM accordingly.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants