-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Bug] Cannot add dependency as tar.gz from URL. #2437
Comments
The issue appears to be on this line:
|
This issue reproduces on master:
|
This is expected; we currently require the package name to be listed, except for local file paths. ie, this isn't supported:
This is:
I'll clarify the error message in the next release, I agree it's currently quite confusing. |
@arcanis Please actually read the issue, I tested the latter (as I researched and found the answer you just gave in #994) and the same error is thrown. I just got the following error on Ubuntu 20.04/Yarn 2.4.0 (so the issue is cross-platform):
|
You need to add the extension, but that seems to highlight another issue
We can actually https://yarnpkg.com/features/protocols#git |
This is interesting. The dependency I am attempting to import is a clone of an existing project (which uses NPM) but it's good to know Yarn supports this. This is kind of a tangent but I'd really like to see a page in the docs that provides a breakdown for "Why should you migrate your project from NPM?" Points could include stuff like speed benchmarks and lists of features that NPM does not support. |
Just as a quick FYI, if anyone here has a site where adding the
in which case it usually isn't counted as part of the URL, so the actual URL is |
We still have this problem in yarn 3. Using |
that trick does work, but how about when specifying a commit? e.g. this fails:
|
Describe the bug
GitPKG is a website which allows the installation of NPM packages from a github repo which is a monorepo, i.e. the individual packages to be installed are located in subdirectories of the main repo. This is a situation that typically cannot be resolved by package managers, since the URL of the repo itself cannot be distinguished from a subdirectory of that repo.
In Yarn v1, the following line can be run:
This will add the
hello
repo to the project's dependencies. Accessing the above URL directly will return a tar.gz file containing the repo data.In Yarn v2, this command will fail with the following stack trace:
I researched the issue here and found #994 (comment), but running
yarn add hello@https://gitpkg.now.sh/EqualMa/gitpkg-hello/packages/hello
provides the same error.To Reproduce
I have reproduced the error, using Sherlock on my local machine.
Reproduction
This is my reproduction case:
Environment if relevant (please complete the following information):
Additional context
I was not able to get Sherlock working properly on the sandbox website due to the following error:
I was able to clone the project to execute Sherlock offline and create the above reproduction.
The text was updated successfully, but these errors were encountered: