-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Cannot yarn add
in workspace package if depending on a local package
#3973
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
Comments
In the rfc has some notes about
But I tried in a project and it's doesn't work anyway :sad: |
What's happening on your side? I just tried |
Tha's happened with me too, |
Yep it should 👌, here is the updated bug report Do you want to request a feature or report a bug? bug What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
Please mention your node.js, yarn and operating system version. node 6.10.2 |
This should be fixed on 1.2.1 - can someone confirm? |
@BYK It works as expected on 1.2.1 |
it works as expected but i cannot add local package as a dev dependency. |
This continues to be an issue as of yarn 1.3.2
Project structure
Issuing either of the following will fail with the "not found" error:
As commented on previously, one would expect either case to work with or without the The only workaround is manually editing |
@Aaike |
Still broken in current
however if you just use
The problem is worse if you local package matches the name of an actual published library, because that will get installed instead of your local one. i.e. if you have a workspace package names |
@flagello Unfortunately, running It would be best to just run |
@flagello any reason for the exact ordering? after all, regular |
Alternatively, we could use |
Sorry @dinvlad, I forgot to mention |
@flagello ah yes, I recall that happened to me to. Thanks for pointing this out. Both variants should work once a fix is implemented, IMO |
One thing that might be related (if anyone can confirm) I have the same issue trying to run a global add from a workspace (trying to global install a workspace module) I tried these from the workspace folder:
None of those worked. Got the same error, yarn tries to get the local package dependencies from yarnpkg registry getting an error of malformed response. yarn 1.6.0 |
…pace packages Previously for a requested dependency pattern to match a package in a workspace, it's name had to match and so did the semver range. If a request specified a non-semver range (like a github url) then it would not match, causing the resolver to attempt to resolve the package on the registry instead of use the workspace package. This change will match a workspace package just on it's name if no valid semver range was found on the requested pattern. fixes yarnpkg#4878 fixes yarnpkg#3973 affects yarnpkg#5726
I believe |
In fact, I've tried |
I'm using Lerna monorepo with yarn. v1.13.0 Please, fix it somehow ;(((( |
I've tried yarn workspace add and that not works too with Yarn 1.19.1
Thanks in advance for any help! |
Same problem for me |
Using yarn 1.220: workspaces + lerna
However, if I use Lerna is using Yarn to install it, but not sure what the underlying difference is. Here's output from running above lerna command: info cli using local version of lerna
lerna notice cli v3.20.2
lerna info versioning independent
lerna notice filter including "my-site"
lerna info filter [ 'my-site' ]
lerna info Adding my-svelte-component-library in 1 package
lerna info bootstrap root only
yarn install v1.21.1
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
✨ Done in 11.11s. edit: Just noticed that lerna is using different yarn version than what I get from running: $ yarn --version
1.22.0 |
All broken on 1.22.0, 1.21.0, and 1.16.0 for me in ubuntu and osx. Manually adding packages is very annoying :( |
I got this error when my paths were with
After I removed
|
I landed here searching for the error I got, and after trying a couple of solutions, I came up with another not yet described, it seems This doesn't work $ yarn add @myscope/package But adding the version works fine $ yarn add @myscope/package@1.0.0 |
THANK YOU |
I was trying to add expo-cli using |
It works for me. If you are using mono repo, you'd better install lerna in root workspace. Use lerna to install a local package. |
In my case the problem was with the presence of trailing slashes in the workspaces declarations: "workspaces": [
"packages/p1/",
"packages/p2/"
] It worked when I removed the trailing slashes: "workspaces": [
"packages/p1",
"packages/p2"
] |
In a similar vein: You'll get an unrelated error message:
|
I had a similar error running the command below. $ yarn add --save-dev @types/sequelize As the dependency has to be installed only in the development environment, I tried to run it with --save-dev but apparently this would work if I had been using NPM. This replaces this command snippet with -D $ yarn add @types/sequelize -D |
I just ran into this issue and the solution which worked for me was to upgrade to Yarn 2 using the instructions here: https://yarnpkg.com/getting-started/migration |
wtf @yarnpkg? there's clearly a problem going on here.
|
@LironEr is my hero 🏆 |
Do you want to request a feature or report a bug?
bug
What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
@scope/b
should be found as it exists in the workspacewhatever
should be added as a dependency of the@scope/a
packagePlease mention your node.js, yarn and operating system version.
node 6.10.2
yarn 0.27.5
osx 10.12.5
The text was updated successfully, but these errors were encountered: