All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] classes/npm: Fix install to use offline option
@ 2017-11-03 10:53 Philippe Coval
  2017-11-03 14:39 ` Davis, Michael
  2017-11-03 22:03 ` Davis, Michael
  0 siblings, 2 replies; 3+ messages in thread
From: Philippe Coval @ 2017-11-03 10:53 UTC (permalink / raw)
  To: openembedded-core

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@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



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] classes/npm: Fix install to use offline option
  2017-11-03 10:53 [PATCH] classes/npm: Fix install to use offline option Philippe Coval
@ 2017-11-03 14:39 ` Davis, Michael
  2017-11-03 22:03 ` Davis, Michael
  1 sibling, 0 replies; 3+ messages in thread
From: Davis, Michael @ 2017-11-03 14:39 UTC (permalink / raw)
  To: Philippe Coval, openembedded-core

Npm v4/v6 have a patch to allow the --no-registry to work.  It was taken out in the transition to Node 8 since the cache system is completely different.
Unfortunately this doesn't work for nodev8 / npmv5 so the offline build on master/rocko is completely broken.
I am trying to get something working by adding the dependency tar.gz directly into the cache manually before the build, but I am running into a npm bug.
https://github.com/nodejs/help/issues/944


-----Original Message-----
From: openembedded-core-bounces@lists.openembedded.org [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of Philippe Coval
Sent: Friday, November 03, 2017 5:54 AM
To: openembedded-core@lists.openembedded.org
Subject: [OE-core] [PATCH] classes/npm: Fix install to use offline option

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@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

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] classes/npm: Fix install to use offline option
  2017-11-03 10:53 [PATCH] classes/npm: Fix install to use offline option Philippe Coval
  2017-11-03 14:39 ` Davis, Michael
@ 2017-11-03 22:03 ` Davis, Michael
  1 sibling, 0 replies; 3+ messages in thread
From: Davis, Michael @ 2017-11-03 22:03 UTC (permalink / raw)
  To: Philippe Coval, openembedded-core

Just an update on this for Philippe and any interested parties.
I started down the line of grabbing the patch and was indeed able to get the tars to add into the cache.  I was also able to get the system to build offline with some manual tweaking.
The main issue I am running into now is that we need a full shrinkwrap after npm install to get the proper information for the cache to pick things up.
This will cause pretty sizable rewrites to how the npm fetcher currently functions, maybe the recipe generator too.

It will be awhile before I have the free time to attempt to something like that so if anyone wants to pick up where I left off send me an email. 
I can supply you with details of what I have done so far.


-----Original Message-----
From: Davis, Michael 
Sent: Friday, November 03, 2017 9:39 AM
To: 'Philippe Coval'; openembedded-core@lists.openembedded.org
Subject: RE: [OE-core] [PATCH] classes/npm: Fix install to use offline option

Npm v4/v6 have a patch to allow the --no-registry to work.  It was taken out in the transition to Node 8 since the cache system is completely different.
Unfortunately this doesn't work for nodev8 / npmv5 so the offline build on master/rocko is completely broken.
I am trying to get something working by adding the dependency tar.gz directly into the cache manually before the build, but I am running into a npm bug.
https://github.com/nodejs/help/issues/944


-----Original Message-----
From: openembedded-core-bounces@lists.openembedded.org [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of Philippe Coval
Sent: Friday, November 03, 2017 5:54 AM
To: openembedded-core@lists.openembedded.org
Subject: [OE-core] [PATCH] classes/npm: Fix install to use offline option

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@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

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-03 22:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-03 10:53 [PATCH] classes/npm: Fix install to use offline option Philippe Coval
2017-11-03 14:39 ` Davis, Michael
2017-11-03 22:03 ` Davis, Michael

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.