parallel icon indicating copy to clipboard operation
parallel copied to clipboard

Parallel `npm` commands are not running on Windows

Open Qsppl opened this issue 9 months ago • 4 comments

DESKTOP-TA4UEMI+Karbonara@DESKTOP-TA4UEMI MINGW64 /c/OSPanel/home/second.investprojects.local (7758-add-frontend-pipeline-into-di)
$ parallel ::: 'npm run _site/testing:run'
parallel: Error: spawn npm run _site/testing:run ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)

Image

Qsppl avatar Mar 25 '25 08:03 Qsppl

I think the problem is you are executing the WHOLE string as command. The example above doesn't quite make sense, it seems like it's running a single command. This tool is meant for running many. For example

parallel npm run {} ::: script1 script2 script3

flesler avatar Mar 25 '25 14:03 flesler

Corrected syntax:

DESKTOP-TA4UEMI+Karbonara@DESKTOP-TA4UEMI MINGW64 /c/OSPanel/home/hybrids (fix(store)-types-of-direct-methods)
$ parallel npm run {} ::: karma lint
parallel: Error: spawn npm ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)

Image

Qsppl avatar Mar 26 '25 07:03 Qsppl

Seems like the environment doesn't have NPM

flesler avatar Mar 26 '25 14:03 flesler

DESKTOP-TA4UEMI+Karbonara@DESKTOP-TA4UEMI MINGW64 /c/OSPanel/home/first.investprojects.local (5304-add-checkbox)
$ parallel npm run {} ::: karma lint
parallel: Error: spawn npm ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)

DESKTOP-TA4UEMI+Karbonara@DESKTOP-TA4UEMI MINGW64 /c/OSPanel/home/first.investprojects.local (5304-add-checkbox)
$ npm -v
10.9.2

DESKTOP-TA4UEMI+Karbonara@DESKTOP-TA4UEMI MINGW64 /c/OSPanel/home/first.investprojects.local (5304-add-checkbox)
$ node -v
v23.9.0

Image

Qsppl avatar Mar 27 '25 18:03 Qsppl