according to SillyTavern docs you cannot install SillyTavern on Windows 7 because it does not support NodeJS 18.16
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
- NodeJS v13.6.0 - the very last version that was tested on Windows 7. this version can be installed via MSI installer
- NodeJS v13.7.0 - v.13.14.0 - can be installed and used on Windows 7 as well but they were never properly tested on Windows 7 (still work fine!)
- starting with NodeJS v14.0.0 - the installation of NodeJs on Windows 7 is no longer available because developers forcefully blocked installation due to "muh Microsoft no longer supports it". when runtime detects Windows 7 it refuses to work
- NodeJS v14.5.0 - added a flag
NODE_SKIP_PLATFORM_CHECKthat allows to skip forced OS check, and nodeJS can be used on Windows 7 (thank you, community for the started shitstorm!) - ...but it didn't fix the issue with MSI installer itself! when installing NodeJS via MSI user would get the error message below. but installation via ZIP works fine
This application is only supported on Windows 8.1, Windows Server 2012 R2, or higher
- NodeJS v20.3.0 - no longer runs on Windows 7 whether
NODE_SKIP_PLATFORM_CHECKflag or not. it just shows the error below. in theory it can be fixed by patching kernel or by loading extra DLL but that's outside of this guide scope
The procedure entry point GetSystemTimePreciseAsFileTime could not be located in the dynamic link library KERNEL32.dll.
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
- delete NodeJS
go to Program and Features -> find Node.js -> uninstall it
it would be better if you used tools like Bulk Crap Uninstaller which can clean up garbage files afterwards, but you do you!
- 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
- download NodeJS v20.2.0
you need to download ZIP (or 7Z) package and NOT MSI installer
- unpack the archive into the folder
C:\Program Files\nodejs
- the most important part!
open command-line: START -> searchcmd-> 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%"
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.
then you didn't set NODE_SKIP_PLATFORM_CHECK flag (see above)
verify
close command-line, and launch it again
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
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
- go to release page and download ZIP version of latest SillyTavern
click on buttonSource code (zip)below
- unpack ZIP archive anywhere you want and click on
start.batfile
- 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]
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
download VxKex and install it
navigate to where you unpacked NodeJS:
C:\Program Files\nodejs
- right-click on
node.exe-> Properties -> VxKex tab ->Enable VxKex for this program-> Apply
- 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
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
- open
cmd(look above), and run the following command in command-line:
npm install hostname-patcher
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
now go SillyTavern folder and open file
server.jsfind 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:
...but honestly? install Notepad++ and use it instead, far better than default Notepad
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)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:
}
then read warning above about installing with both administrative and non-administrative rights
- 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)
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?