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

Load already installed peer dependencies #213

Open
chrisguttandin opened this issue Nov 30, 2018 · 0 comments
Open

Load already installed peer dependencies #213

chrisguttandin opened this issue Nov 30, 2018 · 0 comments

Comments

@chrisguttandin
Copy link

I'm not sure if that is a bug report, a feature request or a stupid idea.

I noticed that npx does not load peer dependencies if the package that is requested via npx has any. I noticed this today while I triaged a bug (chrisguttandin/angular-prerender#25) for one of my packages. It is a little command line tool which is meant to run in a directory which contains an Angular app. Therefore it assumes @angular/core and some other related packages to be installed anyway and defines them as peer dependencies.

When someone now executes the command line tool via npx it can't find the peer dependencies. I came up with a solution (https://github.com/chrisguttandin/angular-prerender/blob/master/src/functions/load-peer-dependencies.ts) but it feels very hacky.

I would therefore like to propose that npx loads peer dependencies from the directory it currently runs in. But it is absolutely possible that I just found an edge case and it makes not much sense to do this for all packages. What do you think?

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