<?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>11902</bug_id>
          
          <creation_ts>2017-08-06 23:37:27 +0000</creation_ts>
          <short_desc>updating npm4 to npm5</short_desc>
          <delta_ts>2020-05-17 02:40:27 +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>core</component>
          <version>unspecified</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>Future</target_milestone>
          
          <blocked>10653</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Stanley Phoong">stanley.cheong.kwan.phoong</reporter>
          <assigned_to name="Unassigned">unassigned</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>henry.bruce</cc>
    
    <cc>jeanmarie.lemetayer</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>75676</commentid>
    <comment_count>0</comment_count>
    <who name="Stanley Phoong">stanley.cheong.kwan.phoong</who>
    <bug_when>2017-08-06 23:37:27 +0000</bug_when>
    <thetext></thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75931</commentid>
    <comment_count>1</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2017-08-17 00:27:19 +0000</bug_when>
    <thetext>Stanley - can you please include some brief details based on our earlier discussion about the motivations for this upgrade and then reassign it back to me? Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76012</commentid>
    <comment_count>2</comment_count>
    <who name="Stanley Phoong">stanley.cheong.kwan.phoong</who>
    <bug_when>2017-08-20 23:53:58 +0000</bug_when>
    <thetext>sorry about that Paul, sure thing.
npm@4 lacking a few feature that would ease up the bitbake fetcher process:

- Has faster installs
- Offline support (if you already installed the modules)
- Lock file for deterministic installs

Hence, using Yarn and npm@5 as a possible alternative is considered to tackle these issues.

After some discussions with Paul here&apos;s some summary:

Yarn would require too much change internally in order to adopt Yarn and Yarn would also require a different workflow.

npm@5 requires lesser changes but doesn&apos;t mean that there&apos;s no change required. npm@5 has all three features that Yarn also provides including lock file to lock the versions of the dependencies.

Simply running a simple &quot;npm install&quot; would automatically trigger the package-lock.json file to be write the version into. No longer a need to explicitly call npm strinkwrap and etc...

The introduction of &quot;package-lock.json, is a new, standardised lockfile feature meant for cross-package-manager compatibility (package-lock.json), and a new format and semantics for shrinkwrap.

The other good news is the installation now take approximately half the original time taken by npm@4.

Additionally, package-lock.json will be automatically created unless an npm-shrinkwrap.json exists. 

Other new feature is &quot;--prefer-offline&quot; and &quot;--prefer-online&quot;, the first option will make npm skip any conditional requests (304 checks) for stale cache data, and only hit the network if something is missing from the cache. While the &quot;prefer-online&quot;, option will force npm to revalidate cached data (with 304 checks), ignoring any staleness checks, and refreshing the cache with revalidated, fresh data.

Also, another thing &quot;--save&quot; is no longer necessary, to force an npm install to write into the package.json.

This should ease out a few issues faced with npm@4 especially regarding the lock file and versions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78987</commentid>
    <comment_count>3</comment_count>
    <who name="Henry Bruce">henry.bruce</who>
    <bug_when>2018-01-10 06:44:59 +0000</bug_when>
    <thetext>Note that only even versions receive LTS (see https://github.com/nodejs/Release#release-schedule), so if investing more effort here, go for v6 or v8.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87219</commentid>
    <comment_count>4</comment_count>
    <who name="Jean-Marie Lemetayer">jeanmarie.lemetayer</who>
    <bug_when>2020-05-17 02:40:27 +0000</bug_when>
    <thetext>Current version:
 - node: 12.14.1
 - npm: 6.13.4</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>