Skip to content
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.

Won't traverse to parents if dir has package.json? #222

Open
jnardone opened this issue Feb 1, 2019 · 0 comments
Open

Won't traverse to parents if dir has package.json? #222

jnardone opened this issue Feb 1, 2019 · 0 comments

Comments

@jnardone
Copy link

jnardone commented Feb 1, 2019

We hoist all our common deps to the top-level parent, as well as common utilities (jest, eslint, pm2, etc.)

However, many of the child folders have their own package.json for one reason or another. (version strings, main: declaration, etc.)

npx won't traverse past the current directory, but only if it has a package.json. (This was reported and then closed in #210)

Example tree:

/package.json
/node_modules
/node_modules/.bin/foo
/packages
/packages/bar
/packages/bar/package.json

I should be able to, in packages/bar, call npx foo and have it resolve. This is expected behavior. But it won't.

If packages/bar does NOT have a package.json, npx foo will resolve to the correct in 2 parents up.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant