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