-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Regression: 0.23.2, yarn uses npm registry for local file dependencies #3187
Comments
It seems there's two separate issues here. The first one is yarn reporting that your package installation is |
Hi, just wanted to add that the issue also appears on a fresh install with the |
If that's so, it's a separate issue. I've tried with the following script and it worked fine: YARN=yarn
rm -rf /tmp/yarntest
mkdir /tmp/yarntest
mkdir /tmp/yarntest/a
echo '{ "name": "a", "version": "1.0.0", "dependencies": { "b": "file:../b" } }' > /tmp/yarntest/a/package.json
mkdir /tmp/yarntest/b
echo '{ "name": "b", "version": "1.0.0" }' > /tmp/yarntest/b/package.json
cd /tmp/yarntest/a
"$YARN" install
cat yarn.lock
ls -l node_modules/b
cat node_modules/b/package.json Can you reproduce it by running it? |
@arcanis First |
Yep, I've been able to reproduce this, but not was @tibdex reported |
The main issue is that we try to be smart about install, and to skip it when we notice that nothing changed in the yarn.lock and the node_modules directory (because it then means that the two of them are in sync). The Not sure what would be the best course of action here. We could always run an install on "volatile" dependencies, but that would have a cost in term of performances :/ |
Your script works fine indeed @arcanis but it fails when you have: // /tmp/yarntest/a/package.json
{
"name": "a",
"version": "1.0.0",
"dependencies": {
"b": "file:../b-1.0.0.tgz"
}
} where The error is:
|
I see. I would expect |
@tibdex That seems like a separate issue; would you mind opening a new issue to keep discussions in the correct order? 😃 @beworker Then good news, it should already work as you described! :D Running install with the Testcase: YARN=yarn
rm -rf /tmp/yarntest
mkdir /tmp/yarntest
mkdir /tmp/yarntest/a
echo '{ "name": "a", "version": "1.0.0", "dependencies": { "b": "file:../b" } }' > /tmp/yarntest/a/package.json
mkdir /tmp/yarntest/b
echo '{ "name": "b", "version": "1.0.0" }' > /tmp/yarntest/b/package.json
cd /tmp/yarntest/a
"$YARN" install
cat yarn.lock
ls -l node_modules/b
cat node_modules/b/package.json
echo '{ "name": "b", "version": "2.0.0" }' > /tmp/yarntest/b/package.json
"$YARN" install
# Won't be updated because the install has been early aborted by the initial check
cat yarn.lock
ls -l node_modules/b
cat node_modules/b/package.json
"$YARN" install --force
# Will be updated because everything has been force-updated
cat yarn.lock
ls -l node_modules/b
cat node_modules/b/package.json |
Hmm... You are right. I believe I tried |
Glad it worked 👍 I'm going to close this issue in favor of #2922 to track the upgrade-interactive behavior, then. |
So I don't get, for me it doesnt'' work in 0.22.0 with --force option too? |
@whitecolor This must be the version which didn't work for me too, because I clearly remember I tried |
I have just switched to stable-0.23 branch, it doesnt' work isn't it not enough? |
@arcanis just wanted to mention that it would be cool having an option for forcing just volatile packages to be reinstalled. For simplicity I would call it |
@arcanis should it work on |
Yes, it should. If it doesn't, can you please put together a small script I can use to reproduce this issue? Like the one above? |
mkdir "test"
cd test
yarn init
mkdir my-local-package
cd my-local-package
yarn init
cd ..
yarn add file:my-local-package
touch my-local-package/change.txt
yarn upgrade my-local-package
# yarn --force
# yarn add file:my-local-package check |
Thanks! I've been able to reproduce it, but not 100% of the time. It seems there's something fishy. Possibly a race condition somewhere. I'm gonna reopen this issue and investigate more. |
For local |
@arcanis has it been fixed? How is it going to work?
|
Yes, this was fixed now. |
Oh I didn't know |
Bug-Report
yarn v0.23.2
macOs v10.12.4
nodejs v6.9.4
Current behavior:
In the main component I have a dependency on a local component as following:
I increase the version of the local
module-model
component and runyarn install
on the main component. Yarn saysAlready up-to-date
which is wrong. After tryingyarn upgrade-interactive
and choosing the componentyarn says that the local component cannot be found on the "npm" registry, which is incorrect behavior.
Instead of checking "npm" registry yarn has to check local directory.
Expected behavior
When
yarn install
is executed, yarn shall check the local dependency component version and if its version differs from the version of the component stored innode_modules
directory, yarn shall updatenode_modules
with the new version of the local component.p.s. As of now the only way to get component updated is to call
yarn add "file:../module-model"
The text was updated successfully, but these errors were encountered: