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

Update required "request" dependency #100

Closed
wants to merge 1 commit into from

Conversation

scottrice10
Copy link

2.69.0 supports features such as baseUrl. In projects with other versions of request being used, the request version used by request-promise is falling back to other versions that don't support these newer features.

@analog-nico
Copy link
Member

This is intentional. It allows the user to choose which version to use. This is particularly important when introducing Request-Promise into an existing project with Request already in use.

If you want to use 2.69.0 in your project npm install request@2.69.0 first and then npm install request-promise. Hope that helps.

@scottrice10
Copy link
Author

Okay @analog-nico . We're using request-promise in a library consumed by several other repos, so it's preferred in our use case to lock the request version in the library itself, rather than the consuming repos.

Setting the request dependency in our library does not lock the request version used by request-promise in the consuming repo. The solution I've found so far to lock the request version used by request-promise is to use npm shrinkwrap in our library, so I will continue with that approach.

@scottrice10
Copy link
Author

Thanks for pointing me to the reasoning why older versions of request are tolerated. I'll close this PR.

@scottrice10 scottrice10 closed this Mar 9, 2016
@analog-nico
Copy link
Member

Hey @scottrice10 npm shrinkwrap as a workaround is quite unfortunate. Let me understand the situation a bit better. I am asking because the next version of Request-Promise will get more involved regarding the dependencies because the user will be able to choose which promise implementation to use. Things shouldn't get worse with the new version and maybe I can even make things a little better.

Are the dependencies like these?

one of several repos
\-- package.json
      request@old-version
      your-lib
\-- node_modules
    \-- request
    \-- your-lib
        \-- package.json
              request-promise
              request@2.69.0 <-- Doesn't matter if this entry is there
        \-- node_modules
            \-- request-promise
                \-- node_modules <-- Doesn't contain request no matter what

@analog-nico
Copy link
Member

Hi @scottrice10 , I just released request-promise@4.0.0 which defines request as a peer dependency. This means you have more influence over which version of request is installed in your project. I hope that helps a bit.

@scottrice10
Copy link
Author

Thanks for the update @analog-nico . Will bump to 4.0.0 and try out defining request as a peer dependency..

@analog-nico
Copy link
Member

You are welcome.

Btw, all you need to do is to install request in your project: npm install request --save. request-promise will always use the request version you installed. That means it will be your decision which version of request you install in your project.

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

Successfully merging this pull request may close these issues.

None yet

2 participants