bcomnes / npm-run-all2

A CLI tool to run multiple npm-scripts in parallel or sequential. (Maintenance fork)
MIT License
262 stars 13 forks source link

Make it work with `npx` #93

Closed zloirock closed 2 years ago

zloirock commented 2 years ago

Original issue: https://github.com/mysticatea/npm-run-all/issues/209

bcomnes commented 2 years ago

Probably should fix this. Anyone attempt patches upstream I can pull in?

zloirock commented 2 years ago

https://github.com/mysticatea/npm-run-all/pull/245

bcomnes commented 2 years ago

Cool ty. I'll look at getting that merged and tested.

bcomnes commented 2 years ago

@MarmadileManteater That would be great and I appreciate it!

bcomnes commented 2 years ago

https://github.com/bcomnes/npm-run-all2/releases/tag/v6.0.3

Reopen if there are issue

zloirock commented 2 years ago

It seems it's still not fixed

image

@MarmadileManteater

bcomnes commented 2 years ago

@zloirock you are right this didn't quite work out.

@MarmadileManteater Can you provide more information on the following env vars you referenced in your patch?

Are these standard or set by a tool somewhere or did you expect people to have to set these?

bcomnes commented 2 years ago

@MarmadileManteater https://github.com/bcomnes/npm-run-all2/pull/96

bcomnes commented 2 years ago

This could be addressed by looking for npm_cli.js in the same directory that npx_cli.js is in since npm_execpath seems to exist on all systems.

Great minds think alike!

zloirock commented 2 years ago

Yep, at debugging I see:

options.npmPath: null
process.env.NPM_CLI_JS: undefined
process.env.npm_execpath: /usr/local/lib/node_modules/npm/bin/npx-cli.js
npmPath: /usr/local/lib/node_modules/npm/bin/npx-cli.js
npmPathIsJs: true
execPath: /usr/local/bin/node

so #96 looks like a proper fix.

bcomnes commented 2 years ago

Ok everyone give https://github.com/bcomnes/npm-run-all2/releases/tag/v6.0.4 a whirl.

zloirock commented 2 years ago

It works for me, thanks 👍