-
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
v0.18.0 postinstall missing dependencies #2142
Comments
This appears to be a dependency problem with fsevents. Your OS, Arch Linux, doesn't support it. If you head over to Strongloop's fsevents Github page, you'll see this in their README
So, I would say this isn't a Yarn issue. The other errors are probably a result of the previous failing. |
@olingern No, it's just an expected warning. It was always there (even with npm or older versions of yarn). I pointed a problem of missing dependencies that must have been installed before Just to be clear about the problem with common dependencies (somewhere in the tree of These two will complete successful: {
"name": "test",
"devDependencies": {
"babel-cli": "^6.18.0"
}
} {
"name": "test",
"devDependencies": {
"gulp-imagemin": "^3.1.1"
}
} But this will lead to the error: {
"name": "test",
"devDependencies": {
"babel-cli": "^6.18.0",
"gulp-imagemin": "^3.1.1"
}
} |
I was able to replicate this on windows. I think it may be related to #2116. I'll try to investigate. |
Looking a little closer, it is optional, so I'll attempt on OSX as well. |
@olingern You're misunderstanding what the problem is. This is a bug. |
@olingern It's just a warning that an optional dependency won't be installed. But the problem is that it messes up with other dependencies required somewhere else. |
@daltones @mvestergaard I see. You guys are right. It looks like dependencies are being ignored when an optional doesn't resolve. |
It's proving difficult to replicate in a test though, it seems like it has to go multiple levels deep. I tried this contrived example:
But that works fine. So I'm going to put the shared dependency deeper and see if that's causing it. |
@mvestergaard Since I was able to install on OSX, looking through the lockfile made figuring the dependency tree easier for this. Interestingly enough, it seems to be rooted in multi-leveled optional dependencies
Important to note above, |
The above was my bad, that works. I've sort of given up on writing a test that replicates this across all platforms. Seems like some sort of edge case. |
In case someone is looking for a temporarily solution, executing a "vanilla" |
Anyone eager to send a PR or a PR with a breaking unit test for starters? |
I have same Everything if fine on Fedora Desktop, but fails on Ubuntu 16.04.1 server (both system uses same |
I'm sorry I can't contribute with formal tests or implementation. But maybe this simplified tree could help:
So the pattern I found was:
|
Another example tree with this issue:
If |
I've attempted to replicate this using the graph provided by @gaearon .. but the test passes.. so I'm still pretty unsure what causes this. I've used the exact version numbers from the graph, including two different versions of Everything except The test is available here: https://github.com/mvestergaard/yarn/commit/9521157ace19bb4d42240532091d8b5402b05ef5 perhaps it can help someone else replicate it. |
Oh, I just realized my tree is from a working build (locally). So maybe CI has a different tree.
Then you can send the PR and see the output in the Travis logs. Updated: I created facebook/create-react-app#1170, let's see how it goes. |
Can you help me by specifying what would be good diagnostic commands to run on the failing environment? |
I wish I could. I'm really just a concerned citizen trying to help out 😊 |
One of the maintainers is reading :)
This is pretty high priority but @kittens and me can't do the fix now.
Help from the community is appreciated
…On Mon, 5 Dec 2016 at 22:26, Mathias Vestergaard ***@***.***> wrote:
I wish I could. I'm really just a concerned citizen trying to help out 😊
Don't you facebook guys have a slack channel or something you can ping one
of the maintainers in? 😁
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2142 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACBdWIW8vMSpM83MUA42weq6fDEaNWWEks5rFI-CgaJpZM4LDodJ>
.
|
@bestander Do you know a way to debug yarn? I may be able to step through it on my windows machine and see if I can find the cause that way. |
@mvestergaard You can attach to a process with vscode or debug using node-inspector |
Yea i tried, but got some minified code. I'll give it another shot. |
@mvestergaard In your Yarn directory: That works for me. Not minified. You can also set breakpoints inside Chrome http://127.0.0.1:8080/?port=5858 in the |
I usually debug with Webstorm.
…On Mon, 5 Dec 2016 at 22:59, Nick Olinger ***@***.***> wrote:
@mvestergaard <https://github.com/mvestergaard>
npm install -g node-inspector
In your Yarn directory:
npm run watch
node-debug bin/yarn.js
That works for me. Not minified
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2142 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACBdWFxs56XEqx2MIfCAYOJ_g7aTcLrNks5rFJdNgaJpZM4LDodJ>
.
|
@mvestergaard You have to pass |
Thanks I managed to debug, not with sourcemaps though. But I think I figured out what's going on. I think I've managed to get this to work, but still haven't been able to replicate in a test though. In for (const info of infos) {
// skip hoisting ignored packages
if (info.ignore) {
continue;
}
this.hoist(info);
} However this breaks the test Using @daltones dependency graph above it seems like what happens is that This causes if (!this.tree.get(parent.key)) {
return null;
}
if (duplicate) {
info.addHistory(`Satisfied from above by ${newKey}`);
this.declareRename(info, rawParts, parts);
return;
} I hope this makes sense to some of you. |
So with that change I was able to install on windows, plus It says this in the test, so I'm not gonna touch it:
It appears that installed packages align with npm after the change above. Meanwhile without the fix
The change is available in https://github.com/mvestergaard/yarn/commit/9c8426c5d3331249cb5971115cfc0a3cba0d59a9 |
@mvestergaard Nice work. I would submit the PR with the change that fixes the issue. Discussion on the implementation/failing test can happen on that PR. |
I think this was accidentally closed by merging #2164. |
Fix is coming |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
I think some dependencies are missing at the time when
postinstall
scripts are ran.I'm having this error:
In another project, after a
yarn upgrade
I also encountered this problem with other packages (gifsicle
'spostinstall
missingdeep-extend
). So it seems like a general problem.If the current behavior is a bug, please provide the steps to reproduce.
Given this
package.json
:Run
yarn install
.I noticed that if I try to install only one of these two, it will work. I guess that's an issue with shared dependencies between them.
What is the expected behavior?
Installation completes successful.
Please mention your node.js, yarn and operating system version.
node.js: v7.2.0
yarn: v0.18.0
OS: Arch Linux
The text was updated successfully, but these errors were encountered: