-
Notifications
You must be signed in to change notification settings - Fork 3k
Don't crash when node.requiredBy is missing. #13519
Conversation
If a package has malformed metadata, this field is sometimes missing.
Hmm, I'm finding more places where this missing |
Yeah, it's really not supposed to be possible for it to be missing. |
I ... don't get a crash with the example you laid out up there. What command are you running? I do get empty results from |
I wish I could reduce the test case. I do know that the npm that comes with node 0.10.x doesn't have this problem and the one that comes with node 6.x does. Sorry if that doesn't help much, there have probably been a ton of npm changes in the intervening years. Is there anything you would like me to test or look for in our code base? The symlink was my initial guess, but it might be something different. |
040beea
to
5b4e3f3
Compare
If a package has malformed metadata, this field is sometimes missing. PR-URL: #13519 Credit: @creationix Reviewed-By: @iarna
This has been merged into |
If a package has malformed metadata, this field is sometimes missing. PR-URL: #13519 Credit: @creationix Reviewed-By: @iarna
This fix works for us in that we're unblocked and can use the newer npm on our old codebase with some probably malformed packages.
$ ls -lh node_modules ... lrwxrwxrwx 1 creationix admins 19 Jul 28 20:09 thrift -> thrift-performance/ drwxrwsr-x 5 creationix admins 4.0K Jul 28 20:31 thrift-performance ...
node_modules/thrift-performance/package.json:
There may be a better way to handle this edge case, but this patch at least prevents the crash and reports something.