Preconditions/Environment ------------------------- poky master Triggering Action/Cause ----------------------- Run this command: devtool add "npm://registry.npmjs.org;name=JSONSelect;version=0.4.0" And then run this command: devtool build jsonselect This then results in this error: NOTE: jsonselect: compiling from external source tree /mnt/ram/mva/poky/build/workspace/sources/jsonselect ERROR: jsonselect-0.4.0-r0 do_package: QA Issue: jsonselect: Files/directories were installed but not shipped in any package: /usr/lib/node_modules/JSONSelect Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install. jsonselect: 1 installed and not shipped files. [installed-vs-shipped] ERROR: jsonselect-0.4.0-r0 do_package: Fatal QA errors found, failing task. ERROR: jsonselect-0.4.0-r0 do_package: Function failed: do_package ERROR: Logfile of failure stored in: /mnt/ram/mva/poky/build/tmp/work/i586-poky-linux/jsonselect/0.4.0-r0/temp/log.do_package.40953 ERROR: Task (/mnt/ram/mva/poky/build/workspace/recipes/jsonselect/jsonselect_0.4.0.bb:do_package) failed with exit code '1' Then checking the sysroot shows that there are two directories. Where other recipes always have one: /poky/build/tmp/work/i586-poky-linux/jsonselect/0.4.0-r0/image/usr/lib/node_modules $ ls -al total 0 drwxr-xr-x 3 builder builder 80 feb 5 12:03 . drwxr-xr-x 3 builder builder 60 feb 5 12:03 .. drwxr-xr-x 2 builder builder 40 feb 5 12:03 jsonselect lrwxrwxrwx 1 builder builder 55 feb 5 12:03 JSONSelect -> ../../../../../../../../../workspace/sources/jsonselect Hypothesis: ----------- Looking at the code in openembedded-core/meta/classes/npm.py, you see that the install dir is defined like this: NPM_INSTALLDIR = "${D}${libdir}/node_modules/${PN}" which uses the package name as the directory. Which differs from the actual install dir, which is always the package name. Note that above errors were all taken from working with the devtool. I also checked it after putting the recipe in the normal layers, and removing from the devtool. Same error shows. [1] https://github.com/openembedded/openembedded-core/blob/master/meta/classes/npm.bbclass#L5
Some background: quite a while ago npm already banned making new packages with uppercase in their name. But there still are packages being depended on that do have uppercase in their name. Which is hard to fix, especially in case these are deep dependencies. As a minimum it would be good to show a more clear error message. The error is especially vague when package with the uppercase name is a dependency. And it would be even better to really fix it. I looked at that already, but I couldn't figure out how to make npm.py access the NPM package name, rather than the recipe name.
This patch, made a few weeks ago, allows to solve it: https://patchwork.openembedded.org/patch/147784 That patch introduces NPMPN, and uses it in all install calls. With that in place, NPMPN can be defined manually in the recipe, using the capitalized name. Like so: ... SRC_URI = "npm://registry.npmjs.org;name=JSONSelect;version=${PV}" NPMPN = "JSONSelect" ... Which fixed the issue. Perhaps now the only thing left to do is fix devtool to add NPMPN to recipes where the NPM package name has upper case characters? Or is there another way to find the original NPM packagename while installing it? I couldn't find it.
Thanks for the patch - merged as follows: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=fa9c077068a2acea04389fa2b44eb2e93548fce2 I don't have the bandwidth to work on this but the patch but I agree with the approach - if you (or someone else) would like to make the necessary changes to devtool (or more specifically recipetool) we would take the patch.
Was this fixed in your recent changes?
With the last work around npm, this seems to be working now. Note that: - the devtool url has been updated (name -> package) - the build is failing with the package JSONSelect due to another issue (#13901) $ devtool add 'npm://registry.npmjs.org;package=JSONStream;version=latest' $ devtool build jsonstream
https://bugzilla.yoctoproject.org/show_bug.cgi?id=13901