darkguy2008 / parallelshell

Run multiple shell commands in parallel
501 stars 44 forks source link

TypeError: "cwd" must be a string #61

Closed mcintosh101 closed 7 years ago

mcintosh101 commented 7 years ago

Hi,

This isn't an issue for me at the moment but though you might like to be aware of it.

I was getting this error when running ParallelShell (V2.0.0):

> app@1.0.0 serve /Users/amci/Sites/business/app/support-app
> parallelshell 'npm run server' 'npm run watch:sass' 'npm run watch:javascript'

/Users/amci/Sites/business/app/support-app
child_process.js:400
    throw new TypeError('"cwd" must be a string');
    ^

TypeError: "cwd" must be a string
    at normalizeSpawnArguments (child_process.js:400:11)
    at exports.spawn (child_process.js:485:38)
    at /Users/amci/Sites/business/app/support-app/node_modules/parallelshell/index.js:105:17
    at Array.forEach (native)
    at Object.<anonymous> (/Users/amci/Sites/business/app/support-app/node_modules/parallelshell/index.js:100:6)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! app@1.0.0 serve: `parallelshell 'npm run server' 'npm run watch:sass' 'npm run watch:javascript'`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the app@1.0.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/amci/.npm/_logs/2017-06-28T16_19_59_702Z-debug.log

I went to the file /Users/amci/Sites/business/app/support-app/node_modules/parallelshell/index.js:105:17 and found the offending line.

When I was logging process.cwd it was a function, not a string. Changing it to process.cwd() fixed the issue.

darkguy2008 commented 7 years ago

Hello.

This has been fixed long time ago, update your version to 3.x.

Thanks!

mcintosh101 commented 7 years ago

Thank you!

AdamWei commented 6 years ago

Thank you!