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

Configured optional dependencies are not optional #221

Closed
thasmo opened this issue Oct 11, 2016 · 7 comments
Closed

Configured optional dependencies are not optional #221

thasmo opened this issue Oct 11, 2016 · 7 comments

Comments

@thasmo
Copy link

thasmo commented Oct 11, 2016

Installing gulp-imagemin using yarn fails - for some reason - to install the optional dependencies, which results in this error when running gulp:

Error: Cannot find module 'imagemin-jpegtran'

This happens probably because the optional dependencies are required nonetheless.

npm's documentation states the following regarding optional dependencies:

It is still your program's responsibility to handle the lack of the dependency. ...
@thasmo
Copy link
Author

thasmo commented Oct 11, 2016

Just found a related issue.

@sindresorhus
Copy link
Owner

sindresorhus commented Oct 12, 2016

Sure. PR welcome. Weird that it works with npm though.

I've commented here how it should be implemented: #224 (comment)

@ekryski
Copy link

ekryski commented Oct 13, 2016

I'm actually having this with NPM as well.

@ekryski
Copy link

ekryski commented Oct 13, 2016

@sindresorhus how do you want to handle it? Just make them regular dependencies?

@michelecocuccio
Copy link

michelecocuccio commented Oct 13, 2016

Having the same problem here using NPM :(

@DevanB
Copy link

DevanB commented Oct 13, 2016

Same issue here. Seems to be gifsicle being the problem for me.

Using NPM.

simison added a commit to simison/gulp-imagemin that referenced this issue Oct 13, 2016
These are required at `index.js` and thus should not be optional.

Fixes sindresorhus#221
sambernard added a commit to MadeInHaus/react-flux-gulp-starter that referenced this issue Oct 18, 2016
@rejas
Copy link

rejas commented Nov 2, 2016

I am really baffled about this thread. Especially that @sindresorhus writes "Weird that it works with npm though." when this PR exists for month: #185
Now I am wondering what I should have done differently to get this through or heard like this thread....

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

No branches or pull requests

6 participants