Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install devDependencies for dependencies when going to run prepare script #7720

Open
MOZGIII opened this issue Nov 28, 2019 · 3 comments
Open

Comments

@MOZGIII
Copy link

MOZGIII commented Nov 28, 2019

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

When dependency is installed from source (i.e. via git+ssh://...) the prepare script is executed, but devDependencies of the dependency are not installed. In the majority of packages that provide the prepare script, dev dependencies are required to successfully execute it.

If the current behavior is a bug, please provide the steps to reproduce.

  1. Create a new dir with package.json in it.
  2. Add any package that provides prepare script and uses it's own dev dependencies to implement the prepare script.
  3. yarn install

The build will end up with the incorrect result.

What is the expected behavior?

Not sure how exactly, but we have to install the devDependencies (in addition to just their regular dependencies) of our dependencies (any kind, i.e. regular dependencies, dev, optional, etc) when we'll be running the prepare script from the dependency.
In particular when we install packages from git.

Please mention your node.js, yarn and operating system version.

$ node -v
v13.1.0
$ yarn -v
1.19.2
$ lsb_release -cs
bionic
@IanVS
Copy link

IanVS commented Dec 27, 2019

@MOZGIII I've used https://github.com/exogen/postinstall-build in the past, but they recommend using prepare instead. I tried using it, and found that it's not working, probably for the reason you specify here. I'd definitely be interested in hearing whether the maintainers see this as a bug or intended behavior.

@MOZGIII
Copy link
Author

MOZGIII commented Dec 27, 2019

Tbh, this might actually already be working, so we need to double-check. I had a pretty complicated setup, but it might not be the real reason I had issues (and this might not be broken). It would be great if someone tried to reproduce it in the cleanroom environment.

@haoadoreorange
Copy link

haoadoreorange commented Jul 10, 2020

any updates ? or workaround ?

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

No branches or pull requests

3 participants