Yarn: Can't add alias from git

Created on 30 Oct 2019  路  5Comments  路  Source: yarnpkg/yarn

yarn add --dev -W html-webpack-plugin-webpack5@npm:https://github.com/PutziSan/html-webpack-plugin

output:

yarn add v1.17.3
[1/5] 馃攳  Validating package.json...
[2/5] 馃攳  Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/%2f/github.com/PutziSan/html-webpack-plugin: Request \"https://registry.yarnpkg.com/%2f/github.com/PutziSan/html-webpack-plugin\" returned a 405".
info If you think this is a bug, please open a bug report with the information provided in "/Users/stavalfi/WebstormProjects/jstream/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
macos mojave 10.14.3 (18D109)
node v13.0.1
npm 6.12.0
yarn 1.19.1

Most helpful comment

@stavalfi the npm: there is the protocol. You don't need it for full URLs, Git URLs etc.

All 5 comments

I don't think we'll ever support this quite corner case so closing. You can achieve what you want by using selective version resolutions instead.

@BYK Not sure how to achieve that. Can you clarify?

  • At the end, I will need 2 versions of that dependency which are reachable from my code using require.

@stavalfi - ah, sorry I didn't realize you needed two copies of that. Why can you not do html-webpack-plugin-webpack5@https://github.com/PutziSan/html-webpack-plugin (dropping the npm: part?)

@BYK I did what the docs said. I'm also not sure what does the npm do:

https://yarnpkg.com/lang/en/docs/cli/add/#toc-yarn-add-alias

image

What will be the result of emiting the npm?

@stavalfi the npm: there is the protocol. You don't need it for full URLs, Git URLs etc.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jiripospisil picture jiripospisil  路  128Comments

NiGhTTraX picture NiGhTTraX  路  173Comments

sfabriece picture sfabriece  路  73Comments

donovan-graham picture donovan-graham  路  115Comments

indieisaconcept picture indieisaconcept  路  90Comments