77
88import { spawn } from 'child_process' ;
99import { fileURLToPath } from 'url' ;
10- import { dirname , join } from 'path' ;
10+ import { dirname , join , delimiter } from 'path' ;
1111import chalk from 'chalk' ;
1212import { existsSync , mkdirSync } from 'fs' ;
1313
@@ -118,9 +118,6 @@ console.log(chalk.cyan(' └─ ') + chalk.white('WebID: ') + chalk.blue.
118118console . log ( '\n' + chalk . dim ( 'Press ' ) + chalk . bold . red ( 'Ctrl+C' ) + chalk . dim ( ' to stop the server\n' ) ) ;
119119console . log ( chalk . yellow ( '⏳ Initializing server components...\n' ) ) ;
120120
121- // Find jss binary
122- const jssBin = join ( __dirname , 'node_modules' , '.bin' , 'jss' ) ;
123-
124121// Build jss arguments
125122const jssArgs = [
126123 'start' ,
@@ -135,11 +132,12 @@ if (!options.multiuser) {
135132 jssArgs . push ( '--no-multiuser' ) ;
136133}
137134
138- // Start JSS
139- const jss = spawn ( jssBin , jssArgs , {
135+ // Start JSS with enhanced PATH to find the binary
136+ const jss = spawn ( 'jss' , jssArgs , {
140137 stdio : 'inherit' ,
141138 env : {
142139 ...process . env ,
140+ PATH : `${ join ( __dirname , 'node_modules' , '.bin' ) } ${ delimiter } ${ process . env . PATH } ` ,
143141 TOKEN_SECRET : process . env . TOKEN_SECRET || 'jssd-default-secret-change-in-production' ,
144142 NODE_ENV : process . env . NODE_ENV || 'development'
145143 }
0 commit comments