Bug 11728

Summary: devtool: fails to build npm://registry.npmjs.org;name=cute-files;version=1.0.2
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Henry Bruce <henry.bruce>
Component: devtools / tool chainAssignee: Unassigned <unassigned>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: bluelightning, ismo.puustinen, jeanmarie.lemetayer, matthew.k.hansen, meta.mr.watcher, meta.watcher, sgw
Version: 2.3.1   
Target Milestone: Future   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: Regression (Used to work)
Verified: Documentation change: Don't know
Bug Depends on:    
Bug Blocks: 10653    

Description Henry Bruce 2017-06-27 22:27:59 UTC
Steps to recreate
=================
$ git clone -b pyro git://git.yoctoproject.org/poky
$ git clone -b pyro git://git.openembedded.org/meta-openembedded
$ source poky/oe-init-build-env
$ bitbake-layers add-layer ../meta-openembedded/meta-oe
$ devtool add "npm://registry.npmjs.org;name=cute-files;version=1.0.2"
$ devtool build cute-files

Observe error (2 more like this)
--------------------------------
ERROR: cute-files-1.0.2-r0 do_install: Function failed: do_install (log file is located at /path/to/build/tmp/work/corei7-64-poky-linux/cute-files/1.0.2-r0/temp/log.do_install.4639)
| npm ERR! Linux 4.10.17-100.fc24.x86_64
| npm ERR! argv "/path/to/build/tmp/work/corei7-64-poky-linux/cute-files/1.0.2-r0/recipe-sysroot-native/usr/bin/node" "/path/to/build/tmp/work/corei7-64-poky-linux/cute-files/1.0.2-r0/recipe-sysroot-native/usr/bin/npm" "install" "--prefix" "/path/to/build/tmp/work/corei7-64-poky-linux/cute-files/1.0.2-r0/image/usr" "-g" "--arch=x64" "--target_arch=x64" "--production" "--no-registry"
| npm ERR! node v4.8.2
| npm ERR! npm  v2.15.11
| 
| npm ERR! Registry not defined and registry files not found: "/path/to/build/tmp/work/corei7-64-poky-linux/cute-files/1.0.2-r0/npm_cache/noregistry/express/.cache.json", "/path/to//build/tmp/work/corei7-64-poky-linux/cute-files/1.0.2-r0/npm_cache/express/.cache.json".

Workaround
==========
Use npm.bbclass do_compile logic from morty
npm_do_install() {
	mkdir -p ${NPM_INSTALLDIR}/
	cp -a ${S}/* ${NPM_INSTALLDIR}/ --no-preserve=ownership
}

Comments
========
1. This is a regression, recipe builds for morty.
2. cute-files was chosen as the example to use in the npm Tips and Tricks article. Article now have to be tagged as invalid.
Comment 1 Paul Eggleton 2017-06-29 09:37:21 UTC
*** Bug 11733 has been marked as a duplicate of this bug. ***
Comment 2 Jean-Marie Lemetayer 2020-05-17 03:38:25 UTC
This is fixed in the master:

% devtool add 'npm://registry.npmjs.org;package=cute-files;version=1.0.2'
% devtool build cute-files