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

continuation-local-storage is still present as a peer dependency on npm #70

Closed
mrhyde opened this issue Oct 22, 2015 · 10 comments
Closed

Comments

@mrhyde
Copy link

mrhyde commented Oct 22, 2015

Since you didn't bump package.json version after commit e2d8dfa continuation-local-storage peer dependency is still present in version shipped by npm and causes warnings

@analog-nico
Copy link
Member

Oh, actually this commit reverts what I added for v1.0.1. But still this peer dependency issue isn't fixed. Do you know a solution?

With the declared peer dependency npm@3 prints:

npm WARN EPEERINVALID request-promise@1.0.1 requires a peer of continuation-local-storage@~3 but none was installed.
npm WARN EPEERINVALID cls-bluebird@1.0.1 requires a peer of continuation-local-storage@~3 but none was installed.

So I removed the declaration again and npm@3 still prints:

npm WARN EPEERINVALID cls-bluebird@1.0.1 requires a peer of continuation-local-storage@~3 but none was installed.

The latter was what I wanted to fix in the first place.

cls-bluebird has continuation-local-storage declared as a peer dependency. However, cls-bluebird's code is only required if the user of Request-Promise calls rp.bindCLS(ns). Maybe I could declare cls-bluebird as an optional dependency or so?!

@mrhyde
Copy link
Author

mrhyde commented Oct 22, 2015

Oh, actually this commit reverts what I added for v1.0.1

Yes, but since it had no positive impact you should be considering to bump npm version.
Solution is to bump version to 1.0.2 and publish it on npm so everyone will stop get this warning :)

In npm@3 peer dependencies are not installed automatically anymore link

Optional dependency is not a solution either since npm will try to install it anyway see

Also, I've created PR for cls-bluebird to fix second warning TimBeyer/cls-bluebird#4

@analog-nico
Copy link
Member

I finally took the time to look into the ways to define dependencies and verified that defining cls-bluebird as a regular dependency is the correct way to go.

Thanks for creating the PR for cls-bluebird! IMHO cls-bluebird is right to define continuation-local-storage as a peer dependency since it depends on the namespace interface. Anyway, I guess we are facing a dependency edge case here.

I will bump the version now.

analog-nico added a commit that referenced this issue Oct 22, 2015
@analog-nico
Copy link
Member

I just published v1.0.2 on npm. Thanks for your contribution!

@hildjj
Copy link
Contributor

hildjj commented Nov 19, 2015

Since the CLS support is optional, could you just drop the cls-bluebird dependency, and explain in the readme that you need to depend on that and continuation-local-storage if you want to use the feature? I'd rather not take the dependencies in my project since I'm not going to use the feature.

hildjj added a commit to hildjj/request-promise that referenced this issue Nov 19, 2015
@mrhyde
Copy link
Author

mrhyde commented Nov 20, 2015

Note that this kind of changed will require major version bump, so it won't break anyone's code

@analog-nico
Copy link
Member

Indeed. BTW, we discussed in #75 how to proceed.

@toboid
Copy link

toboid commented Dec 14, 2015

Also worth noting that in addition to the warning npm shrinkwrap fails when using request-promise due to the cls-bluebird peer dependency on continuation-local-storage. Had to work-around by adding an explicit dependency on continuation-local-storage.

noahsw added a commit to winsleague/winsleague that referenced this issue Dec 30, 2015
@analog-nico
Copy link
Member

Hi @toboid I just released request-promise@2.0.0. npm shrinkwrap works now.

@toboid
Copy link

toboid commented Jan 12, 2016

great 😄

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

4 participants