-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Cannot add URLs as dependencies in custom cli plugin #1177
Comments
@joelearn, based on the npm documentation it looks like the example you provided isn't actually valid? Your URL looks like a git repo ( |
@dhensche Yep, it was just an example (and perhaps a bad one at that!). I thought it might've been valid since if you My actual use-case was with the git+file protocol - that's when I first encountered the problem. |
it may just be missing from the npm documentation. I'll take note of that. In coming up with a solution, I was assuming that the core Vue guys (I'm just doing this in some free time) would like to try and maintain the smart dependency merging that tries to use the latest version of a dependency. According to the npm documentation you can specify a semver version when using Git URLs so I was going to take that into account |
npm supports multiple "version" strings when declaring deps in your `package.json`. This PR is an attempt to support some of these other formats in a plugin specification, while retaining the smart version merging. If a semver range can be extracted, it will be used for version conflict resolution. If not, a warning will be displayed to the developer
Version
3.0.0-beta.6
Steps to reproduce
In a new vue-cli-plugin, add to generator.js:
Then invoke the plugin on a vue-cli 3 project.
What is expected?
Dependencies should be added to package.json, whether they are defined as semver, URL, or anything valid (see: https://docs.npmjs.com/files/package.json#dependencies)
What is actually happening?
A warning "invalid version range for dependency" is displayed in the console but the dependency merge is skipped.
The text was updated successfully, but these errors were encountered: