[OE-core] [PATCH] classes/npm: Fix install to use offline option
Philippe Coval
philippe.coval at osg.samsung.com
Fri Nov 3 10:53:52 UTC 2017
Option --no-registry seems deprecated or even non supported for ages,
while --offline fixed the problem on install task.
Issue can be reproduced using:
devtool add "npm://registry.npmjs.org;name=epoll;version=latest"
bitbake epoll
| DEBUG: Executing shell function do_install
(...)
| npm ERR! argv ".../node" ".../npm" "install" (...) "--production" "--no-registry"
| npm ERR! node v6.11.0
| npm ERR! npm v3.10.10
| npm ERR! registry URL is required
And also from log file ".../epoll/1.0.0-r0/npmpkg/npm-debug.log":
silly mapToRegistry using default registry
41 silly mapToRegistry registry null
42 verbose stack AssertionError: registry URL is required
42 verbose stack at Conf.getCredentialsByURI (.../get-credentials-by-uri.js:8:3)
More relevent insights:
https://github.com/npm/npm/issues/2568#
Signed-off-by: Philippe Coval <philippe.coval at osg.samsung.com>
---
meta/classes/npm.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass
index a69bedb..dfd1ffe 100644
--- a/meta/classes/npm.bbclass
+++ b/meta/classes/npm.bbclass
@@ -45,7 +45,7 @@ npm_do_install() {
# be created in this directory
export HOME=${WORKDIR}
mkdir -p ${NPM_INSTALLDIR}/
- npm install --prefix ${D}${prefix} -g --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --production --no-registry
+ npm install --prefix ${D}${prefix} -g --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --production --offline
if [ -d ${D}${prefix}/etc ] ; then
# This will be empty
rmdir ${D}${prefix}/etc
--
1.9.1
More information about the Openembedded-core
mailing list