npm / npx

npm package executor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FEATURE] Support running npx in a specified directory (like npm --prefix)

abbasyadollahi opened this issue · comments

What / Why

Being able to run npx from a parent folder would be more practical for a project with multiple sub projects.

How

Current Behavior

Currently it can be done in npm with npm --prefix path/to/dir run install.

Expected Behavior

It could run the same as npm does, ie npx --prefix path/to/sub yarn install.

References

It was a requested feature before under zkat.
zkat/npx#226

Why not (cd path/to/sub && npx yarn install)?

That's what I'm currently doing, although I felt like it was more of an anti pattern.

This might even already work with v7 of npm since npx will is going to be maintained as part of npm and is basically a shorthand for npm exec.

See #30

PS: If it doesn't work you might want to file this issue over there.