npm-run-all
npm-run-all copied to clipboard
Infinite loop with the command
I have set up the following scripts but the pscale script seems to be called infinitely, while the first attempt successfully initializes the connection to the database. Is it intended behavior and I miss some settings/parameters to include?
"scripts": {
"start": "npm-run-all -p start pscale",
"program": "ts-node --transpile-only api/app.ts",
"pscale": "pscale connect publication next",
},
Successful run by individual call
C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server>npm run pscale
> [email protected] pscale C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> pscale connect publication next
Secure connection to database publication and branch next is established!.
Local address to connect your application: 127.0.0.1:3306 (press ctrl-c to quit)
Terminate batch job (Y/N)?
^C
Unsuccessful run by calling them all
C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server>npm start
> [email protected] start C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> npm-run-all -p start pscale
> [email protected] pscale C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> pscale connect publication next
> [email protected] start C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> npm-run-all -p start pscale
> [email protected] pscale C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> pscale connect publication next
> [email protected] start C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> npm-run-all -p start pscale
> [email protected] start C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> npm-run-all -p start pscale
> [email protected] pscale C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> pscale connect publication next
> [email protected] start C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> npm-run-all -p start pscale
> [email protected] pscale C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> pscale connect publication next
Secure connection to database publication and branch next is established!.
Local address to connect your application: 127.0.0.1:3306 (press ctrl-c to quit)
Tried address 127.0.0.1:3306, but it's already in use. Picking up a random port ...
> [email protected] pscale C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> pscale connect publication next
> [email protected] start C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> npm-run-all -p start pscale
Error: Get "https://api.planetscale.com/v1/organizations/kemakino/databases/publication/branches/next": context canceled
Error: Get "https://api.planetscale.com/v1/organizations/kemakino/databases/publication/branches/next": context canceled
Terminate batch job (Y/N)?
^C
C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server>Secure connection to database publication and branch next is established!.
Local address to connect your application: 127.0.0.1:3306 (press ctrl-c to quit)
Secure connection to database publication and branch next is established!.
Local address to connect your application: 127.0.0.1:51199 (press ctrl-c to quit)
you are unintentionally fork bombing yourself with this: "start": "npm-run-all -p start pscale",
the start script is running the start script, which then runs the start script, which then runs the start script ...
i assume you meant to put something else there instead of start, maybe program?