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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This repo gives a simple test of what happens with npm v3, flattening, and incremental npm updates.
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
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.
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.
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.