<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace;font-size:small">Yes, it helps.<br>Now I see my error... I need to use<br>SRC_URI = &quot;npm://<a href="http://registry.npmjs.org" rel="noreferrer" target="_blank">registry.npmjs.org</a>;name=${PN};version=${PV}&quot;<br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small">My recipe it&#39;s getting sources from github and not from registry.<br><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small">Thanks!<br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small"> <br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 4, 2016 at 12:07 PM, Brendan Le Foll <span dir="ltr">&lt;<a href="mailto:brendan.le.foll@intel.com" target="_blank">brendan.le.foll@intel.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, May 04, 2016 at 11:53:08AM -0300, Fabio Berton wrote:<br>
&gt;    Hi Brendan,<br>
&gt;    Thanks for reply.<br>
&gt;    I&#39;m trying to use npm class with this layer<br>
</span>&gt;    [1]<a href="https://github.com/imyller/meta-nodejs" rel="noreferrer" target="_blank">https://github.com/imyller/meta-nodejs</a><br>
<span class="">&gt;    For example, I changed this recipe<br>
</span>&gt;    [2]<a href="https://github.com/imyller/meta-nodejs/blob/master/recipes/grunt/gru" rel="noreferrer" target="_blank">https://github.com/imyller/meta-nodejs/blob/master/recipes/grunt/gru</a><br>
<span class="">&gt;    <a href="http://nt-cli_1.1.0.bb" rel="noreferrer" target="_blank">nt-cli_1.1.0.bb</a> to use npm class provided by oe-core and removed all<br>
&gt;    classes from meta-nodejs.<br>
<br>
</span>I&#39;m not sure where that npm class is from but it&#39;s not the one from<br>
openembedded-core? With that npm.bbclass I&#39;m able to build grunt-cli with a<br>
simple recipe like this:<br>
<br>
SUMMARY = &quot;Grunt.js command line wrapper&quot;<br>
HOMEPAGE = &quot;<a href="http://gruntjs.com/" rel="noreferrer" target="_blank">http://gruntjs.com/</a>&quot;<br>
SECTION = &quot;js/devel&quot;<br>
LICENSE = &quot;MIT&quot;<br>
LIC_FILES_CHKSUM = &quot;file://README.md;md5=a24cc788ab726e615aa5bf0168c5d77d&quot;<br>
SRC_URI = &quot;npm://<a href="http://registry.npmjs.org" rel="noreferrer" target="_blank">registry.npmjs.org</a>;name=${PN};version=${PV}&quot;<br>
inherit npm<br>
<br>
Does that help? Note the license isn&#39;t downloaded by npm so I cheekily took the<br>
README.md for the md5 license check ;-) That probably needs to get fixed, using<br>
the package.json would likely be nicer...<br>
<br>
Cheers,<br>
Brendan<br>
<span class=""><br>
&gt;    I can install grunt-cli If I remove S = ${WORKDIR}/npmpkg and<br>
&gt;    --no-registry option.<br>
&gt;    I put PREFERRED_VERSION_nodejs-native on local.conf to set nodejs<br>
&gt;    version and I tried with all versions available on meta-nodejs and<br>
&gt;    meta-oe version, that has patch to enable --no-registry.<br>
&gt;    I&#39;ll try with nodejs version that you&#39;re using.<br>
&gt;<br>
&gt;    On Wed, May 4, 2016 at 11:38 AM, Brendan Le Foll<br>
</span><span class="">&gt;    &lt;[3]<a href="mailto:brendan.le.foll@intel.com">brendan.le.foll@intel.com</a>&gt; wrote:<br>
&gt;<br>
&gt;      On Tue, May 03, 2016 at 01:24:49PM -0300, Fabio Berton wrote:<br>
&gt;      &gt;    Hi all!<br>
&gt;      &gt;    I&#39;m trying to install some recipes that use npm class and I<br>
&gt;      have two<br>
&gt;      &gt;    questions.<br>
&gt;      &gt;    1 - Why use S = &quot;${WORKDIR}/npmpkg&quot;? This not work for me.<br>
&gt;      That&#39;s surprising the fetcher basically extracts it that way so the<br>
&gt;      class just defaults to that location as &#39;the right thing&#39;. Do you<br>
&gt;      have<br>
&gt;      an example recipe that isn&#39;t working that I could take a look at?<br>
&gt;      &gt;    2 - Using option --no-registry inside npm_do_compile task I get<br>
&gt;      this<br>
&gt;      &gt;    error:<br>
&gt;      &gt;    | npm ERR! Registry not defined and registry files not found:<br>
&gt;      &gt;<br>
&gt;      &quot;/home/user/prj/build/tmp/work/all-linux-musleabi/gulp-cli/1.2.1-r0/<br>
&gt;      npm<br>
&gt;      &gt;    _cache/noregistry/wreck/.cache.json&quot;,<br>
&gt;      &gt;<br>
&gt;      &quot;/home/user/prj/build/tmp/work/all-linux-musleabi/gulp-cli/1.2.1-r0/<br>
&gt;      npm<br>
&gt;      &gt;    _cache/wreck/.cache.json&quot;.<br>
&gt;      &gt;    | npm ERR!<br>
&gt;      &gt;    | npm ERR! If you need help, you may report this error at:<br>
</span>&gt;      &gt;    | npm ERR!     &lt;[1][4]<a href="https://github.com/npm/npm/issues" rel="noreferrer" target="_blank">https://github.com/npm/npm/issues</a>&gt;<br>
<span class="">&gt;      &gt;    | npm ERR! Linux 3.18.0-trunk-amd64<br>
&gt;      &gt;    | npm ERR! argv<br>
&gt;      &gt;    &quot;/home/user/prj/build/tmp/sysroots/x86_64-linux/usr/bin/node&quot;<br>
&gt;      &gt;    &quot;/home/user/prj/build/tmp/sysroots/x86_64-linux/usr/bin/npm&quot;<br>
&gt;      &gt;    &quot;--arch=arm&quot; &quot;--production&quot; &quot;--no-registry&quot; &quot;install&quot;<br>
&gt;      &gt;    | npm ERR! node v4.4.1<br>
&gt;      &gt;    | npm ERR! npm  v2.14.20<br>
</span>&gt;      &gt;    I found this issue [2][5]<a href="https://github.com/npm/npm/issues/5509" rel="noreferrer" target="_blank">https://github.com/npm/npm/issues/5509</a><br>
<span class="">&gt;      and using<br>
&gt;      &gt;    --cache-min 99999 instead of --no-registry this error doesn&#39;t<br>
&gt;      appears<br>
&gt;      &gt;    and build works fine.<br>
&gt;      &gt;    I noticed that nodejs recipe is using this patch<br>
&gt;      &gt;<br>
</span>&gt;      [3][6]<a href="https://github.com/bendaaron/meta-oe-dev/commit/3e02a40d689a70" rel="noreferrer" target="_blank">https://github.com/bendaaron/meta-oe-dev/commit/3e02a40d689a70</a><br>
<span class="">&gt;      025472<br>
&gt;      &gt;    15473a00606d8213ce0c<br>
&gt;      &gt;    but seems not fix for me.<br>
&gt;      So I saw this, and ignored it since --no-registry was working fine<br>
&gt;      for<br>
&gt;      me with that patch and then with 4.2.x. It seems the cache-min<br>
&gt;      option<br>
&gt;      doesn&#39;t always work as intented.<br>
&gt;      I fired up a build with 4.4.x from<br>
</span>&gt;      [7]<a href="https://github.com/ostroproject/meta-iot-web/blob/master/recipes-" rel="noreferrer" target="_blank">https://github.com/ostroproject/meta-iot-web/blob/master/recipes-</a><br>
<span class="">&gt;      devtools/nodejs/<a href="http://nodejs_4.4.1.bb" rel="noreferrer" target="_blank">nodejs_4.4.1.bb</a><br>
&gt;      and it seemed to build ok for me with --no-registry.<br>
&gt;      Cheers,<br>
&gt;      Brendan<br>
&gt;<br>
</span>&gt; References<br>
&gt;<br>
&gt;    1. <a href="https://github.com/imyller/meta-nodejs" rel="noreferrer" target="_blank">https://github.com/imyller/meta-nodejs</a><br>
&gt;    2. <a href="https://github.com/imyller/meta-nodejs/blob/master/recipes/grunt/grunt-cli_1.1.0.bb" rel="noreferrer" target="_blank">https://github.com/imyller/meta-nodejs/blob/master/recipes/grunt/grunt-cli_1.1.0.bb</a><br>
&gt;    3. mailto:<a href="mailto:brendan.le.foll@intel.com">brendan.le.foll@intel.com</a><br>
&gt;    4. <a href="https://github.com/npm/npm/issues" rel="noreferrer" target="_blank">https://github.com/npm/npm/issues</a><br>
&gt;    5. <a href="https://github.com/npm/npm/issues/5509" rel="noreferrer" target="_blank">https://github.com/npm/npm/issues/5509</a><br>
&gt;    6. <a href="https://github.com/bendaaron/meta-oe-dev/commit/3e02a40d689a70025472" rel="noreferrer" target="_blank">https://github.com/bendaaron/meta-oe-dev/commit/3e02a40d689a70025472</a><br>
&gt;    7. <a href="https://github.com/ostroproject/meta-iot-web/blob/master/recipes-devtools/nodejs/nodejs_4.4.1.bb" rel="noreferrer" target="_blank">https://github.com/ostroproject/meta-iot-web/blob/master/recipes-devtools/nodejs/nodejs_4.4.1.bb</a><br>
</blockquote></div><br></div>