<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>10337</bug_id>
          
          <creation_ts>2016-09-27 22:12:02 +0000</creation_ts>
          <short_desc>devtool: fails to add an npm project if nodejs-native is not already built</short_desc>
          <delta_ts>2016-10-05 19:38:50 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>2.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.2 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Henry Bruce">henry.bruce</reporter>
          <assigned_to name="Paul Eggleton">bluelightning</assigned_to>
          <cc>brian.avery</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>66658</commentid>
    <comment_count>0</comment_count>
    <who name="Henry Bruce">henry.bruce</who>
    <bug_when>2016-09-27 22:12:02 +0000</bug_when>
    <thetext>Observed behavior
-----------------
$ devtool add &quot;npm://registry.npmjs.org;name=grunt-cli;version=1.1.0&quot;
ERROR: Command &apos;recipetool --color=always create -o /tmp/devtooll09swkt2 &quot;npm://registry.npmjs.org;name=grunt-cli;version=1.1.0&quot;  -x /path/to/build/workspace/sources/devtoolsrcuogngddz&apos; failed:
ERROR: npm:// URL requested but npm is not available - you need to either build nodejs-native or install npm using your package manager

If you run &apos;bitbake nodejs-native&apos; *OR* install node on host system, then rerun above devtool add command it complete OK.

Observed behavior
-----------------
[build]$ devtool add &quot;npm://registry.npmjs.org;name=grunt-cli;version=1.1.0&quot;
Command completes without error and does not require nodejs-native to be man ually build aHEAD OF TIME.

Notes
------
1. This is a regression. The above &apos;devtool add&apos; command works on krogoth.
2. nodejs-native recipe should not allow fallback to node installed on host</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66700</commentid>
    <comment_count>1</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2016-09-28 19:36:37 +0000</bug_when>
    <thetext>1. devtool add did require npm on krogoth - there&apos;s no way it could fetch the source for the specified npm package without it. It may be that we check for it now where we didn&apos;t before. I&apos;ll have to investigate. Do you have npm available on your host?

2. Not sure I understand what you mean - should *not* allow ?

If devtool attempted to build nodejs-native if it could not run npm, would that be OK?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66718</commentid>
    <comment_count>2</comment_count>
    <who name="Stephen K Jolley">sjolley.yp.pm</who>
    <bug_when>2016-09-29 14:46:38 +0000</bug_when>
    <thetext>Henry - please comment</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66719</commentid>
    <comment_count>3</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2016-09-29 14:48:47 +0000</bug_when>
    <thetext>yes.  I believe so.  It seems like we should either:
1) document that to use the node functionality you need to have host npm
or
2) (better, i think) just try to build nodejs-native if not available.

When I had no host npm and had built nodejs-native, it worked.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66730</commentid>
    <comment_count>4</comment_count>
    <who name="Henry Bruce">henry.bruce</who>
    <bug_when>2016-09-29 17:28:11 +0000</bug_when>
    <thetext>To extend on my original comments

1. To clarify observed behavior on krogoth
When running devtool add &quot;npm://registry.npmjs.org;name=grunt-cli;version=1.1.0&quot; 
&apos;devtool add&apos; fetches and builds nodejs-native then completes successfully
&apos;devtool build grunt-cli&apos; will then complete successfully

2. On master the observed behavior (i.e. failure) can be avoided if npm is installed on host. We should update devtool&apos;s npm support to avoid using host&apos;s npm as its version is not controlled and force use of npm from nodejs-native. Thus if nodejs-native is not available, &apos;devtool add&apos; of npm project should fail.

I hope that makes more sense.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66961</commentid>
    <comment_count>5</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2016-10-05 19:38:50 +0000</bug_when>
    <thetext>Fix merged to master:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=18caacae069a025662fcdd96b846857fc3107e41</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>