build(postinstall): postinstall script to downgrade typeorm on windows (#836)

* build(postinstall): postinstall script to downgrade typeorm on windows

This is a temporary fix for windows baremetal users until we fix #478

re #478

* fix: use win32 as explained in nodejs docs
This commit is contained in:
Fallenbagel
2024-06-24 19:07:25 +05:00
committed by GitHub
parent 268c7df28e
commit d18972b9aa
3 changed files with 14 additions and 1 deletions

13
postinstall-win.js Normal file
View File

@@ -0,0 +1,13 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
if (process.platform === 'win32') {
const typeormPath = path.resolve('node_modules/typeorm');
if (fs.existsSync(typeormPath)) {
process.stdout.write('> Installing typeorm@0.3.11 for Windows\n');
execSync('pnpm add typeorm@0.3.11', { stdio: 'inherit' });
}
}