diff options
authorPaul Eggleton <>2017-02-07 09:08:50 +1300
committerRichard Purdie <>2017-02-07 14:35:12 +0000
commitc0c50d43266150a80be31ae2c6fcaf37f5ba231d (patch)
parent433379bf12cf31fdf46defdf66695cf8be9994b1 (diff)
fetch2/npm: handle items only in optionalDependencies
An npm package.json file has two dependency fields: dependencies and optionalDependencies. An item in optionalDependencies *may* also be listed in dependencies, but this is not required (and not necessary since if it's in optionalDependencies it will be optional, adding it to dependencies won't do anything). The code here was assuming that an optional dependency would always be in both, that's probably because that was true of the examples I was looking at at the time. To fix it, just add the optional ones to the list we're iterating over. Signed-off-by: Paul Eggleton <> Signed-off-by: Richard Purdie <>
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/bb/fetch2/ b/lib/bb/fetch2/
index 3e352922e0..8c32f81c74 100644
--- a/lib/bb/fetch2/
+++ b/lib/bb/fetch2/
@@ -195,6 +195,7 @@ class Npm(FetchMethod):
dependencies = pdata.get('dependencies', {})
optionalDependencies = pdata.get('optionalDependencies', {})
+ dependencies.update(optionalDependencies)
depsfound = {}
optdepsfound = {}
data[pkg]['deps'] = {}