Bug 11728 - devtool: fails to build npm://registry.npmjs.org;name=cute-files;version=1.0.2
Summary: devtool: fails to build npm://registry.npmjs.org;name=cute-files;version=1.0.2
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 2.3.1
Hardware: x86 Multiple
: Medium normal
Target Milestone: Future
Assignee: Unassigned
QA Contact:
URL:
Whiteboard:
: 11733 (view as bug list)
Depends on:
Blocks: 10653
  Show dependency tree
 
Reported: 2017-06-27 22:27 UTC by Henry Bruce
Modified: 2020-05-17 03:38 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: Regression (Used to work)
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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