FormidableLabs/install-experiments-npmv3

Name: install-experiments-npmv3

Owner: Formidable

Description: Installation experiments with npm v3.

Created: 2016-04-06 17:59:34.0

Updated: 2016-04-06 17:59:34.0

Pushed: 2016-04-06 18:58:31.0

Homepage: null

Size: 2

Language: null

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Install Experiments!

This repo gives a simple test of what happens with npm v3, flattening, and incremental npm updates.

Starting Point
root>/package.json

ependencies": {
"builder": "2.9.0",
"lodash": "^3.10.1"


Builder has the exact same lodash requirements: "^3.10.1"

Commands:

m install
all-experiments@0.0.1 /Users/rroemer/scm/fmd/install-experiments
builder@2.9.0
? SNIPPED
lodash@3.10.1

Where is lodash?

nd . -name lodash
de_modules/lodash
Experiment - npm install

Now, let's upgrade lodash via package.json!

root>/package.json

ependencies": {
"builder": "2.9.0",
"lodash": "^4.8.2"


With this diff:

it diff
 --git a/package.json b/package.json
x 1e79df8..1330008 100644
a/package.json
b/package.json
6,6 +6,6 @@
license": "MIT",
dependencies": {
 "builder": "2.9.0",
 "lodash": "^3.10.1"
 "lodash": "^4.8.2"


And now just run another npm install:

m install
all-experiments@0.0.1 /Users/rroemer/scm/fmd/install-experiments
builder@2.9.0
? lodash@3.10.1
lodash@4.8.2

Where is lodash? Looks to be in both places, as we want:

nd . -name lodash
de_modules/builder/node_modules/lodash
de_modules/lodash

Conclusion: Works as expected.

Experiment - npm install –save VERSION

Now, let's upgrade lodash via the command line!

m install --save lodash@4.8.2
all-experiments@0.0.1 /Users/rroemer/scm/fmd/install-experiments
builder@2.9.0
? lodash@3.10.1
lodash@4.8.2

Where is lodash? Looks to be in both places, as we want:

nd . -name lodash
de_modules/builder/node_modules/lodash
de_modules/lodash

Conclusion: Works as expected.

Experiment - npm shrinkwrap

First, let's shrinkwrap:

m shrinkwrap

Baseline test: re-install from scratch produces same tree:

 -r node_modules
m install
all-experiments@0.0.1 /Users/rroemer/scm/fmd/install-experiments
builder@2.9.0
? SNIPPED
lodash@3.10.1

Update the shrinkwrap. Diff:

 --git a/package.json b/package.json
x 0927aed..7bcd26e 100644
a/package.json
b/package.json
13,6 +13,6 @@
,
dependencies": {
 "builder": "2.9.0",
 "lodash": "^3.10.1"
 "lodash": "^4.8.2"


Remove existing shrinkwrap and recreate:

 npm-shrinkwrap.json
m install
m shrinkwrap

produces the expected diff:

 --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
x 5a4fedb..b99722a 100644
a/npm-shrinkwrap.json
b/npm-shrinkwrap.json
29,7 +29,14 @@
 },
 "builder": {
   "version": "2.9.0",
   "from": "builder@2.9.0"
   "from": "builder@2.9.0",
   "dependencies": {
     "lodash": {
       "version": "3.10.1",
       "from": "lodash@>=3.10.1 <4.0.0",
       "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz"
     }
   }
 },
 "chalk": {
   "version": "1.1.3",
57,9 +64,9 @@
   "resolved": "https://npme.walmart.com/j/js-yaml/_attachments/js-yaml-3.5.5.tgz"
 },
 "lodash": {
   "version": "3.10.1",
   "from": "lodash@>=3.10.1 <4.0.0",
   "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz"
   "version": "4.8.2",
   "from": "lodash@>=4.8.2 <5.0.0",
   "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.8.2.tgz"
 },
 "nopt": {
   "version": "3.0.6",

Conclusion: Works as expected.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.