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

Scoped Packages - "yarn add" (not "yarn") throws error #5263

Open
mblandfo opened this issue Jan 21, 2018 · 7 comments
Open

Scoped Packages - "yarn add" (not "yarn") throws error #5263

mblandfo opened this issue Jan 21, 2018 · 7 comments

Comments

@mblandfo
Copy link

Do you want to request a feature or report a bug?
bug

What is the current behavior?

Yarn add command cannot install this published package: https://www.npmjs.com/package/@google-cloud/translate

$ yarn add @google-cloud/translate
yarn add v1.3.2
[1/4] Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@google-cloud/
translate: Not found".

npm can install it correctly:

$npm install @google-cloud/translate --save

"yarn" does install it correctly if it is in the package.json, it is just "yarn add" that fails.

Interestingly, bluebird gives a slightly different error:

$ yarn add @types/bluebird
yarn add v1.3.2
[1/4] Resolving packages...
error Couldn't find package "@types\\bluebird" on the "npm" registry.

Both work from package.json, and wrapping them in quotes in yarn add doesn't matter.

Please mention your node.js, yarn and operating system version.
yarn 1.3.2
node v8.9.4
Windows 7

Related: #4354 #4366

@ghost ghost assigned rally25rs Jan 21, 2018
@ghost ghost added the triaged label Jan 21, 2018
@rally25rs
Copy link
Contributor

rally25rs commented Jan 29, 2018

Seems to work OK for me.

~/Projects/yarn-test 🐒   yarn add @google-cloud/translate
yarn add v1.4.0
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Saved lockfile.
success Saved 94 new dependencies.
✨  Done in 2.99s.

~/Projects/yarn-test 🐒   yarn add @types/bluebird
yarn add v1.4.0
warning package.json: No license field
warning No license field
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
└─ @types/bluebird@3.5.20
warning No license field
✨  Done in 0.73s.

~/Projects/yarn-test 🐒   cat package.json
{
  "dependencies": {
    "@google-cloud/translate": "^1.1.0",
    "@types/bluebird": "^3.5.20"
  }
}
~/Projects/yarn-test 🐒   rm -rf node_modules/

~/Projects/yarn-test 🐒   yarn
yarn install v1.4.0
warning package.json: No license field
warning No license field
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
✨  Done in 0.72s.

Maybe try upgrading to yarn v1.4 and see if it's already fixed?

@mblandfo
Copy link
Author

No, I still see the issue on windows 7.

$ yarn add @google-cloud/translate
yarn add v1.4.1-20180129.1936
info No lockfile found.
[1/4] Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@google-cloud/
translate: Not found".

@daelmaak
Copy link

daelmaak commented May 7, 2018

Still an issue on win10 with yarn 1.6.0
Seems like it has something to do with scoped packages. I don't have problem installing those without '@'

$ yarn add @ngx-translate/core
yarn add v1.6.0
[1/4] Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@ngx-translate/core: 
Not found".

@rally25rs
Copy link
Contributor

I still can't reproduce this. Tried on Win 10, yarn 1.5.1, powershell and it still worked for me. If someone why can consistently reproduce this can help debug, we would appreciate it.

What should happen is that yarn uses the url https://registry.yarnpkg.com/@google-cloud%2ftranslate but instead it is putting a / instead of the %2f.

@daelmaak
Copy link

daelmaak commented May 8, 2018

I was playing around and found out it doesn't happen in windows terminal, but it fails when attempting yarn add @ngx-translate/core in git bash.

@prayerslayer
Copy link

prayerslayer commented May 15, 2018

Can confirm this issue. Package: https://www.npmjs.com/package/@types/react I realize now it's because of a typo: types/react (correct) vs typed/react (what i tried). Sorry for wasting everyone's time.

$> yarn add --dev @typed/react                                                                                     
yarn add v1.5.1
[1/4] 🔍  Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@typed%2freact: Not found".
info If you think this is a bug, please open a bug report with the information provided in "[stripped]".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

macOS 10.13.2
iTerm2 3.1.6
fish 2.7.1 / bash 3.2
yarn 1.5.1
node 8.9.3

Problem persists after upgrading to node 9.11.1 and yarn 1.6.0. Same if I add the package to my package.json:

$> yarn                                                                                                             14:33:58
yarn install v1.6.0
[1/4] 🔍  Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@typed%2freact: Not found".

@dvelasquez25
Copy link

Can confirm this issue
Ubuntu 20.04
Yarn 1.22.5
Node 12.18.0
Zsh 5.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants