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

[Bug] yarn add fails by specifying the remote URL #994

Closed
1 task
flymans opened this issue Feb 25, 2020 · 8 comments
Closed
1 task

[Bug] yarn add fails by specifying the remote URL #994

flymans opened this issue Feb 25, 2020 · 8 comments
Labels
bug Something isn't working

Comments

@flymans
Copy link

flymans commented Feb 25, 2020

  • I'd be willing to implement a fix

Describe the bug

After calling yarn add <git remote url> error is thrown: Invalid descriptor.
For example:

yarn add https://github.com/fancyapps/fancybox
Internal Error: Invalid descriptor (https://github.com/fancyapps/fancybox)
    at Object.parseDescriptor (/mnt/c/Users/pas/dev/admin-app/.yarn/releases/yarn-sources.js:48444:26)
    at /mnt/c/Users/pas/dev/admin-app/.yarn/releases/yarn-sources.js:84576:31
    at Array.map (<anonymous>)
    at AddCommand.execute (/mnt/c/Users/pas/dev/admin-app/.yarn/releases/yarn-sources.js:84571:60)
    at async AddCommand.validateAndExecute (/mnt/c/Users/pas/dev/admin-app/.yarn/releases/yarn-sources.js:55036:26)
    at async Cli.run (/mnt/c/Users/pas/dev/admin-app/.yarn/releases/yarn-sources.js:51907:24)
    at async Cli.runExit (/mnt/c/Users/pas/dev/admin-app/.yarn/releases/yarn-sources.js:51916:28)

To Reproduce
yarn add <git remote URL> e.g.:
yarn add https://github.com/fancyapps/fancybox

Environment if relevant (please complete the following information):

  • Node version v12.13.0
  • Yarn version 2.0.0-rc.29.git.20200223.fbd94ea8
@flymans flymans added the bug Something isn't working label Feb 25, 2020
@arcanis
Copy link
Member

arcanis commented Feb 27, 2020

Manually specify the package name: yarn add fancybox@fancyapps/fancybox

@arcanis arcanis closed this as completed Feb 27, 2020
@flymans
Copy link
Author

flymans commented Mar 10, 2020

Manually specify the package name: yarn add fancybox@fancyapps/fancybox

The problem is, I still can't add dependency from my gitlab private repository.
The same error - Invalid descriptor.

@arcanis
Copy link
Member

arcanis commented Mar 10, 2020

Invalid descriptor is a syntax error. If you don't print the command line, I can't tell you more than that 🙂

@flymans
Copy link
Author

flymans commented Mar 10, 2020

yarn add git+ssh://<git remote URL>#semver:^3.2.0

Internal Error: Invalid descriptor
    at Object.parseDescriptor (.yarn\releases\yarn-sources.js:44115:26)
    at .yarn\releases\yarn-sources.js:83566:31
    at Array.map (<anonymous>)
    at AddCommand.execute (.yarn\releases\yarn-sources.js:83561:60)
    at async AddCommand.validateAndExecute (.yarn\releases\yarn-sources.js:50708:26)
    at async Cli.run (.yarn\releases\yarn-sources.js:47579:24)
    at async Cli.runExit (.yarn\releases\yarn-sources.js:47588:28)

Note: no minified build

@glow-mdsol
Copy link

Looks like the specific issue arises here:
https://github.com/yarnpkg/berry/blob/master/packages/yarnpkg-core/sources/structUtils.ts#L194-L196
The regex doesn't seem to match any of the patterns in the docs.

I cheated by using npm followed by yarn install but it still seemed unable to resolve the pattern. I gave up and went back to v1.23

@arcanis
Copy link
Member

arcanis commented May 14, 2020

You're missing the package name:

yarn add <package name>@git+ssh://<git remote URL>#semver:^3.2.0

We only infer the package name from local directories at the moment.

@Sogl
Copy link

Sogl commented May 25, 2023

My installation freezes:

laradock@3edd7fd0dc0c:/var/www/sogl$ yarn add lightGallery@github:sachinchoolur/lightGallery -D
➤ YN0000: ┌ Resolution step
➤ YN0013: │ lightGallery@https://github.com/sachinchoolur/lightGallery.git#commit=f691d0096a4ee00641e1a3be22d4101e715f3ff3 can't be found in the cache 
➤ YN0013: │ lightGallery@https://github.com/sachinchoolur/lightGallery.git#commit=f691d0096a4ee00641e1a3be22d4101e715f3ff3 can't be found in the cache 
➤ YN0000: ⠼ unicode-property-aliases-ecmascript@npm:^1.0.4

Also add commant don't support --verbose option...

The Macintosh is warming up a lot, but nothing happens...

Yarn 3.5.1

Issue created: #5465

@ChidoYo
Copy link

ChidoYo commented Mar 5, 2024

I have tried the above sample but I'm getting the following error:
error Can't add "<package-name>": invalid package version "1.0"
My package is on my company's GitLab repo. The version on the package.json is 1.0.
Do I need to make the version number contain three digits?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants