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

yarn link breaks with scoped packages. #5083

Open
richburdon opened this issue Dec 13, 2017 · 18 comments
Open

yarn link breaks with scoped packages. #5083

richburdon opened this issue Dec 13, 2017 · 18 comments
Assignees
Labels

Comments

@richburdon
Copy link

richburdon commented Dec 13, 2017

This is a bug.

What is the current behavior?

> cd package1/
> yarn link
info You can now run `yarn link "@company/package1"` in the projects where you want to use this module and it will be used instead.

> cd package2/
> yarn link "@company/package1"
> yarn add "@company/package1"
error An unexpected error occurred: "https://registry.yarnpkg.com/@company%2fpackage1: Not found".

The same error occurs if the named package is already in package.json before calling yarn install.

NOTE: yarn link seems to create the appropriate symlink. I.e.,

./node_modules/@company/package1 -> ../../../package1

I've also confirmed that yarn install works if I'm just using the published package (i.e., not using link).

If the current behavior is a bug, please provide the steps to reproduce.
ABOVE.

What is the expected behavior?
The linked package should be used.

Please mention your node.js, yarn and operating system version.
node v9.2.1
yarn 1.3.2
OS/X 10.13.1

@ghost ghost assigned torifat Dec 13, 2017
@ghost ghost added the triaged label Dec 13, 2017
@torifat
Copy link
Member

torifat commented Dec 13, 2017

Why are you doing yarn add "@company/package1"?

@richburdon
Copy link
Author

That's my scoped package. I.e., I have an npm organization @company (I mean it's not called that, but for example) and a private package called package1.

@filipposarzana
Copy link

We are having the same issue 😢 Any news on this?

@Coridyn
Copy link

Coridyn commented Feb 2, 2018

We use npm's private organisation scope and have had issues getting them installed with Yarn.

My workaround was to explicitly set my Yarn registry to https://registry.npmjs.org/ (i.e. our organisation private registry happens to be the npm registry) and I am now able to link and install my private scoped organisation modules.

$ yarn config set registry https://registry.npmjs.org/

This is with Yarn 1.3.2 on Windows 10

@timrs2998
Copy link

I can confirm this issue with Yarn 1.3.2 on macOS Sierra 10.12.6

@tanguyantoine
Copy link

Same issue

@efortes
Copy link

efortes commented Jun 8, 2018

I have the same issue.
@Coridyn your registry change worked: $ yarn config set registry https://registry.npmjs.org/

@jherdman
Copy link

jherdman commented Oct 4, 2018

The registry hack doesn't seem to be working for me on yarn 1.10.

@kristian
Copy link

Any update here? Also does not work with v1.12.0!

@maximelafarie
Copy link

Same error with version 1.12.3. What's the status of this issue given that some other people also faced it? 🤔

@MikeMitterer
Copy link

Recently I switch from Dart to TS and I'm always surprised how such thing like working with local modules/packages can still be a problem in the JS world. 1.12.3

@armordog
Copy link

My coworker has this problem on MacOS (Sierra 10.12.6) with yarn 1.13.0.

yarn link with scoped packages works fine for me on Windows 10 (yarn 1.10.1).

@RobMayer
Copy link

still a thing with yarn 1.19.1 on Win 7, I'm afraid.

@EthanJStark
Copy link

Also have this issue on MacOS 10.14.6

@simpleshadow
Copy link

Workaround for me was to escape the forward-slash and manually add to package.json dependencies:

yarn link @company\/package-name

@redmundas
Copy link

I have the same issue on linux machine and the solution provided by @simpleshadow works for me 👍

@naavis
Copy link

naavis commented Feb 11, 2021

I am still having the same error as in the starting post of this thread, on Windows 10. Linking the package by escaping the forward slash does not help either. Manually adding the package to dependencies in package.json and running yarn install results in the same error.

Not sure if it makes a difference, but I am trying to test a package that has not been published to any registry yet, so it only exists on my hard drive. Why does it still try to search for it on registry.yarnpkg.com after linking?

@naavis
Copy link

naavis commented Feb 11, 2021

Turns out there's a separate ticket for this: #2611

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

No branches or pull requests