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

Ignore nested package.json #165

Open
Happy-Ferret opened this issue Mar 21, 2018 · 2 comments
Open

Ignore nested package.json #165

Happy-Ferret opened this issue Mar 21, 2018 · 2 comments

Comments

@Happy-Ferret
Copy link

I'm sure this is a very specific use-case and one that might not be easily achievable with the current way npm works, but I thought I might ask anyways.

Basically, I'm working on a React component library and was hoping to use npx to run a script defined in the root directory's package.json.

Here's the thing that currently makes me struggle though:

Every component of mine consists of a .js, a .css, a README.md and, yes, a package.json file (which contains one single field. main).

The way npm/npx seem to work is that they consider the folder with the package.json in it the root directory. Which means scripts defined in the actual root package.json aren't found and attempting to call an installed node_modules binary actually downloads the particular node module (since the node module doesn't exist in the component directory AKA the directory npx then erroneously considers the root project directory).

Question: Is there a way to ignore those package.json files inside projectName/src/components/componentName and always fall pack to the package.json inside projectName/?

@zkat
Copy link
Owner

zkat commented May 3, 2018

I'm confused by this. Can you put together a repro of what you mean? npx doesn't execute run-scripts, only binaries.

@blackmamo
Copy link

I think this may well be a duplicate of this #118

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

No branches or pull requests

3 participants