mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2025-12-23 18:29:19 -05:00
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:
@@ -59,7 +59,6 @@ Pre-requisites:
|
|||||||
npm i -g win-node-env
|
npm i -g win-node-env
|
||||||
set CYPRESS_INSTALL_BINARY=0
|
set CYPRESS_INSTALL_BINARY=0
|
||||||
pnpm install --frozen-lockfile
|
pnpm install --frozen-lockfile
|
||||||
pnpm add typeorm@0.13.11
|
|
||||||
pnpm run build
|
pnpm run build
|
||||||
pnpm start
|
pnpm start
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"preinstall": "npx only-allow pnpm",
|
"preinstall": "npx only-allow pnpm",
|
||||||
|
"postinstall": "node postinstall-win.js",
|
||||||
"dev": "nodemon -e ts --watch server --watch overseerr-api.yml -e .json,.ts,.yml -x ts-node -r tsconfig-paths/register --files --project server/tsconfig.json server/index.ts",
|
"dev": "nodemon -e ts --watch server --watch overseerr-api.yml -e .json,.ts,.yml -x ts-node -r tsconfig-paths/register --files --project server/tsconfig.json server/index.ts",
|
||||||
"build:server": "tsc --project server/tsconfig.json && copyfiles -u 2 server/templates/**/*.{html,pug} dist/templates && tsc-alias -p server/tsconfig.json",
|
"build:server": "tsc --project server/tsconfig.json && copyfiles -u 2 server/templates/**/*.{html,pug} dist/templates && tsc-alias -p server/tsconfig.json",
|
||||||
"build:next": "next build",
|
"build:next": "next build",
|
||||||
|
|||||||
13
postinstall-win.js
Normal file
13
postinstall-win.js
Normal 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' });
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user