<<< return to main page

according to SillyTavern docs you cannot install SillyTavern on Windows 7 because it does not support NodeJS 18.16
image failed to load

let me tell you - this is a bucking lie

in this guide we will install NodeJS 20.0.2 on windows 7, and successfully launch the latest SillyTavern

NodeJS Windows 7 support

This application is only supported on Windows 8.1, Windows Server 2012 R2, or higher

image failed to load

The procedure entry point GetSystemTimePreciseAsFileTime could not be located in the dynamic link library KERNEL32.dll.

image failed to load

so this means the last version of NodeJS that can be installed in Windows 7 without headache - v20.2.0 (afaik)

install NodeJS on Windows 7

uninstall and clean

first of all, if you already tried to install NodeJS on Windows 7 yourself then you probably installed it wrong and made a complete mess. before going further, let's clean up and fix possible issues. if you never installed NodeJS before then you may skip this section

  1. delete NodeJS

go to Program and Features -> find Node.js -> uninstall it

image failed to load

it would be better if you used tools like Bulk Crap Uninstaller which can clean up garbage files afterwards, but you do you!

image failed to load

  1. delete the following folders:
C:\Program Files\nodejs
C:\Users\%your_profile_name%\AppData\Local\npm-cache
C:\Users\%your_profile_name%\AppData\npm 
C:\Users\%your_profile_name%\AppData\npm-cache

they may contain leftovers and cache, that can mess with new NodeJS install

download and install NodeJS

  1. download NodeJS v20.2.0

you need to download ZIP (or 7Z) package and NOT MSI installer

  1. unpack the archive into the folder
C:\Program Files\nodejs

image failed to load

  1. the most important part!
    open command-line: START -> search cmd -> right click -> run as administrator
    use the following two commands in command-line one by one:
setx NODE_SKIP_PLATFORM_CHECK 1
setx PATH "C:\Program Files\nodejs;%PATH%"

image failed to load

first will let NodeJS to be run on Windows 7 (will skip warning message that your system is outdated)
second will register both NodeJS and NPM into OS

if you get the error message

Node.js is only supported on Windows 8.1, Windows Server 2012 R2, or higher.
Setting the NODE_SKIP_PLATFORM_CHECK environment variable to 1 skips this check, but Node.js might not execute correctly.
Any issues encountered on unsupported platforms will not be fixed.

image failed to load

then you didn't set NODE_SKIP_PLATFORM_CHECK flag (see above)

verify

  1. close command-line, and launch it again

  2. use the following two commands:

node -v
npm -v

they both check the installed NodeJS and NPM versions. commands must return:

node = v20.2.0
npm = v9.6.6

image failed to load

if so then congratulations! you have installed NodeJS on Windows 7!

installing SillyTavern on Windows 7

download and install ST

now lets install SillyTavern itself

  1. go to release page and download ZIP version of latest SillyTavern
    click on button Source code (zip) below

image failed to load

  1. unpack ZIP archive anywhere you want and click on start.bat file

image failed to load

  1. if you did everything right then you will get the error message:
code: 'ERR_SYSTEM_ERROR',
info: {
errno: -4054,
code: 'ENOSYS',
message: 'function not implemented',
syscall: 'uv_os_gethostname'
},
errno: [Getter/Setter],
syscall: [Getter/Setter]

image failed to load

do not worry! we will fix it soon

this error message means that SillyTavern's inner libraries cannot detect what OS you are using: the libraries use API (commands) that are not available in Windows 7 hence SillyTavern cannot detect OS on start. the are two well-known possible fixes...

fix for uv_os_gethostname №1

you can install a small tool - VxKex - that injects into software which doesn't work correctly on Windows 7. it injects extra API and libraries for backward compatibility

  1. download VxKex and install it

  2. navigate to where you unpacked NodeJS:

C:\Program Files\nodejs
  1. right-click on node.exe -> Properties -> VxKex tab -> Enable VxKex for this program -> Apply

image failed to load

  1. try to launch SillyTavern now (start.bat). it should work fine
    the downside to this method is that it may be an overkill for one small problem

image failed to load

fix for uv_os_gethostname №2

if you don't want to use VxKex then your other option is hostname-patcher
this library can be 'installed' into any NodeJS-based software to patch the uv_os_gethostname error

  1. open cmd (look above), and run the following command in command-line:
npm install hostname-patcher

image failed to load

this will install hostname-patcher globally on your machine, so you will be able to easily add it anywhere you want.

very important
please use this command twice:
- first install it, when CMD is launched with administrative rights
- second time, when CMD is launched without administrative rights
why?
because your Windows account might be into whether Administrators group or Users group
so we must install in two different ways to cover both cases

  1. now go SillyTavern folder and open file server.js

  2. find this line at the start of the file:

#!/usr/bin/env node

right after that line, add two more lines and save your changes:

require('hostname-patcher');
const os = require('os');

for SillyTavern 1.12.7+ you must use different command:

import hostnamePatcher from 'hostname-patcher';
import os from 'os';

in default Nodepad it will look like this:
image failed to load

...but honestly? install Notepad++ and use it instead, far better than default Notepad
image failed to load

image failed to load

  1. try launching SillyTavern again (start.bat). it should work fine
    the downside to this method is that if you update SillyTavern, you will need to redo steps (2-3)

  2. if you have the following error message:

Error: Cannot find module 'hostname-patcher'
Require stack:
at Module._load (node:internal/modules/cjs/loader:923:27
at Module.require (node: internal/modules/cjs/loader:1137:19)
at require (node:internal/modules/helpers:121:18>
at Module._compile (node: internal/modules/cjs/loader:1255:14) at Module_extensions..js (node: internal/modules/cjs/loader:1309:10)
at Module.load (node: internal/modules/cjs/loader: 1113:32) Module._load (node:internal/modules/cjs/loader: 960:12>
at at Function.executeUserEntry Point [as runMain]
in:83:12 ) {
code: 'MODULE_NOT_FOUND',
requireStack:
}

image failed to load

then read warning above about installing with both administrative and non-administrative rights

  1. if you have the following error message:
> ReferenceError: require is not defined in ES module scope, you can use import instead 
This file is being treated as an ES module because it has a '.js' file extension and
'...\SillyTavern-1.12.7\package.json' contains "type": "module". To treat it as a CommonJ5 script,
rename it to use the '.cjs' file extension. at file:.../SillyTavern-1.12.7/server.js:3:1
at ModuleJob.run (node:internal/modules/esm/module_job:192:25)

image failed to load

then use import command instead of require


congrats! you have successfully installed NodeJS 20.2.0 on Windows 7, and you have made it work with SillyTavern!
wasn't too hard, right?