All of lore.kernel.org
 help / color / mirror / Atom feed
* Fun with npm shrinkwrap
@ 2017-06-06 10:17 Jan Kiszka
  2017-06-06 14:12 ` Alexander Kanavin
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Kiszka @ 2017-06-06 10:17 UTC (permalink / raw)
  To: openembedded-core; +Cc: Paul Eggleton

Hi all,

devtool add / recipetool create do not work properly /wrt shrinkwrap
when it comes to node-red-node-serialport. npm shrinkwrap finds a number
of extraneous packages and refuses to generate an output.

There are various workarounds discussed in [1]. For me this seems to
work:

diff --git a/scripts/lib/recipetool/create_npm.py b/scripts/lib/recipetool/create_npm.py
index cb8f338b8b..8ce952bb4c 100644
--- a/scripts/lib/recipetool/create_npm.py
+++ b/scripts/lib/recipetool/create_npm.py
@@ -68,6 +68,8 @@ class NpmRecipeHandler(RecipeHandler):
     def _shrinkwrap(self, srctree, localfilesdir, extravalues, lines_before, d):
         try:
             runenv = dict(os.environ, PATH=d.getVar('PATH'))
+            bb.process.run('rm -rf node_modules', cwd=srctree, stderr=subprocess.STDOUT, env=runenv, shell=True)
+            bb.process.run('npm install', cwd=srctree, stderr=subprocess.STDOUT, env=runenv, shell=True)
             bb.process.run('npm shrinkwrap', cwd=srctree, stderr=subprocess.STDOUT, env=runenv, shell=True)
         except bb.process.ExecutionError as e:
             logger.warn('npm shrinkwrap failed:\n%s' % e.stdout)


But it may have unwanted side effects. So, what would be the proper way
to address this issue?

Thanks,
Jan

-- 
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux


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

end of thread, other threads:[~2017-06-07 19:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-06 10:17 Fun with npm shrinkwrap Jan Kiszka
2017-06-06 14:12 ` Alexander Kanavin
2017-06-06 15:14   ` Jan Kiszka
2017-06-07 11:43     ` Alexander Kanavin
2017-06-07 12:04       ` Jan Kiszka
2017-06-07 14:09         ` Davis, Michael
2017-06-07 18:32           ` Jan Kiszka
2017-06-07 19:51             ` 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.