Last active
December 23, 2024 14:53
-
-
Save alanhogan/a32889830384f4e190fa to your computer and use it in GitHub Desktop.
Revisions
-
alanhogan revised this gist
Apr 1, 2016 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,8 @@ If you do that *and* manually change references in the shrinkwrap file, you will 2. See if that correctly updated both `npm-shrinkwrap.json` and `package.json`. ¯\\\_(ツ)\_/¯ 3. You will now probably have to run `npm shrinkwrap --dev`. If you see errors, this means people have been updating `package.json` without keeping the shrinkwrap file up to date. We’d shame them, but honestly `npm` should probably do this for you… **Consistent but initially risky long option** -
alanhogan revised this gist
Mar 31, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -40,4 +40,4 @@ If you do that *and* manually change references in the shrinkwrap file, you will This will recreate a new version of your shrinkwrap file. **Note** You may have to remove extraneous packages, because Shrinkwrap will yell at you and stop in its tracks if there are packages installed but not listed in package.json. For some reason (**update:** Because of `harmony` — this should not happen on ZDI), this means, for me, that I always seem to have to run `rm -rf node_modules/npm-install-retry`. ¯\\\_(ツ)\_/¯ -
alanhogan revised this gist
Mar 31, 2016 . 1 changed file with 10 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,16 @@ If you change the version of `ember-cli` to, say, `1.13.8` in `package.json` and If you do that *and* manually change references in the shrinkwrap file, you will _still_ have trouble (as nested dependencies may now be incorrect). ### So what do we actually do? **The minimal effort option — not entirely sure if it works** 1. Run `npm install` with options just like this: `npm install --save-dev --save-exact ember-cli@1.13.8` 2. See if that correctly updated both `npm-shrinkwrap.json` and `package.json`. ¯\\\_(ツ)\_/¯ **Consistent but initially risky long option** 1. `rm npm-shrinkwrap.json` -
alanhogan revised this gist
Nov 11, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,7 +23,7 @@ If you do that *and* manually change references in the shrinkwrap file, you will (If one of these approaches works better for you, [let me know](https://alanhogan.com/contact?reason=npm-shrinkwrap-update-package) and I will update this gist.) Pay attention to any `npm WARN` lines you may get. Some of these warnings (lack of README) are fine to ignore. Others (unmet dependency) will be considered **hard errors** by `shrinkwrap`, because consistency. (irony alert.) You may need to [fix these upstream](https://github.com/ember-cli/ember-cli/issues/5057). This particular time, the cause was `ember-cli` having a `bundledDependency` that was incompatible with the versions specified by its other `dependencies`. Again, it's only a warning in `npm install`-land, but a serious, full-stop error to `npm shrinkwrap`. 💀 ☠ 💀 3. Finally, run -
alanhogan revised this gist
Nov 11, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,7 +23,7 @@ If you do that *and* manually change references in the shrinkwrap file, you will (If one of these approaches works better for you, [let me know](https://alanhogan.com/contact?reason=npm-shrinkwrap-update-package) and I will update this gist.) Pay attention to any `npm WARN` lines you may get. Some of these warnings (lack of README) are fine to ignore. Others (unmet dependency) will be considered **hard errors** by `shrinkwrap`, because consistency. (irony alert.) You may need to [fix these upstream](https://github.com/ember-cli/ember-cli/issues/5057). This particular time, the cause was `ember-cli` having a `bundledDependency` that was incompatible with the versions specified by its other `dependencies`. Again, it's only a warning in `npm install`-land, but a serious, full-stop error to `npm shrinkwrap`. :skull: ☠ :skull: 3. Finally, run -
alanhogan revised this gist
Nov 11, 2015 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,6 +22,8 @@ If you do that *and* manually change references in the shrinkwrap file, you will Note that without `--save-exact` your `package.json` will use the `^` caret matcher. (Although this may not matter thanks to shrinkwrap anyway…?) (If one of these approaches works better for you, [let me know](https://alanhogan.com/contact?reason=npm-shrinkwrap-update-package) and I will update this gist.) Pay attention to any `npm WARN` lines you may get. Some of these warnings (lack of README) are fine to ignore. Others (unmet dependency) will be considered **hard errors** by `shrinkwrap`, because consistency. (irony alert.) You may need to [fix these upstream](https://github.com/ember-cli/ember-cli/issues/5057). This particular time, the cause was `ember-cli` having a `bundledDependency` that was incompatible with the versions specified by its other `dependencies`. Again, it's only a warning in `npm install`-land, but a serious, full-stop error to `npm shrinkwrap`. :skull: :skull_and_crossbones: :skull: 3. Finally, run -
alanhogan revised this gist
Nov 11, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,7 @@ If you do that *and* manually change references in the shrinkwrap file, you will 2. Update your `package.json` so your package is the version you want, `rm -rf node_modules/ember-cli`, and then `npm install`. Or, run `npm install --save-dev --save-exact ember-cli@1.13.8` Note that without `--save-exact` your `package.json` will use the `^` caret matcher. (Although this may not matter thanks to shrinkwrap anyway…?) -
alanhogan revised this gist
Nov 11, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,4 +29,4 @@ If you do that *and* manually change references in the shrinkwrap file, you will This will recreate a new version of your shrinkwrap file. **Note** You may have to remove extraneous packages, because Shrinkwrap will yell at you and stop in its tracks if there are packages installed but not listed in package.json. For some reason, this means, for me, that I always seem to have to run `rm -rf node_modules/npm-install-retry`. ¯\\\_(ツ)\_/¯ -
alanhogan revised this gist
Nov 11, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,14 +10,14 @@ If you do that *and* manually change references in the shrinkwrap file, you will 1. `rm npm-shrinkwrap.json` This is not ideal, as you may theoretically get lots of new versions of unrelated packages' dependencies, but it seems to be necessary; otherwise, because your new version of `ember-cli` has itself updated the versions of its dependencies to versions incompatible with those your shrinkwrap, you are going to end up with invalid packages. And that is something that `npm shrinkwrap` will *not* abide. Hey, at least this is happening to you on development, not a production deploy. 2. Update your `package.json` so your package is the version you want, `rm -rf node_modules/ember-cli`, and then `npm install`. Or, run `npm install --save-dev --save-exact ember-cli@1.13.8`n Note that without `--save-exact` your `package.json` will use the `^` caret matcher. (Although this may not matter thanks to shrinkwrap anyway…?) -
alanhogan revised this gist
Nov 11, 2015 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ If you do that *and* manually change references in the shrinkwrap file, you will 1. `rm npm-shrinkwrap.json` This is not ideal, as you may theoretically get lots of new versions of unrelated packages' dependencies, but it seems to be necessary; otherwise, because your new version of `ember-cli` has itself updated the versions of its dependencies to versions incompatible with those your shrinkwrap, you are going to end up with invalid packages. And `npm shrinkwrap` will *not* abide. Hey, at least this is happening to you on development, not a production deploy. @@ -20,6 +20,8 @@ If you do that *and* manually change references in the shrinkwrap file, you will `npm install --save-dev --save-exact ember-cli@1.13.8` Note that without `--save-exact` your `package.json` will use the `^` caret matcher. (Although this may not matter thanks to shrinkwrap anyway…?) (If one of these approaches works better for you, [let me know](https://alanhogan.com/contact?reason=npm-shrinkwrap-update-package) and I will update this gist.) 3. Finally, run -
alanhogan revised this gist
Nov 11, 2015 . 1 changed file with 16 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,12 +8,23 @@ If you do that *and* manually change references in the shrinkwrap file, you will **So what do we actually do?** 1. `rm npm-shrinkwrap.json` This is not ideal, as you are going to get lots of new versions of packages' packages, but it seems to be necessary. Otherwise, when `ember-cli` updates the versions of packages it uses to versions not specified in your shrinkwrap, you are going to end up with invalid packages. Hey, at least this is happening to you on development, not a production deploy. 2. Update your `package.json` so your package is the version you want, `rm -rf node_modules/ember-cli`, and then `npm install`. Or, run `npm install --save-dev --save-exact ember-cli@1.13.8` Note that without `--save-exact` your `package.json` will use the `^` caret matcher. (Although this may not matter thanks to shrinkwrap anyway…?) 3. Finally, run `npm shrinkwrap --dev` This will recreate a new version of your shrinkwrap file. **Note** You may have to remove extraneous packages, because Shrinkwrap will yet at you if there are packages installed but not listed in package.json. For some reason, this means, for me, that I always seem to have to run `rm -rf node_modules/npm-install-retry`. ¯\\\_(ツ)\_/¯ -
alanhogan revised this gist
Nov 11, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,4 +16,4 @@ Note that without `--save-exact` your `package.json` will use the `^` caret matc This will update the shrinkwrap file. **Note** You may have to remove extraneous packages, because Shrinkwrap will yet at you if there are packages installed but not listed in package.json. For some reason, this means, for me, that I always seem to have to run `rm -rf node_modules/npm-install-retry`. ¯\\\_(ツ)\_/¯ -
alanhogan created this gist
Nov 11, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ `npm shrinkwrap` is useful, but maddening (once it's in place and you want to update a package). Say you've got a `package.json` with module `ember-cli` as a `devDependency` currently at version `1.13.1`. And you have an `npm-shrinkwrap.json` file too, generated with the `--dev` flag. If you change the version of `ember-cli` to, say, `1.13.8` in `package.json` and run `npm install`, nothing will happen. If you do that *and* manually change references in the shrinkwrap file, you will _still_ have trouble (as nested dependencies may now be incorrect). **So what do we actually do?** `npm install --save-dev --save-exact ember-cli@1.13.8` Note that without `--save-exact` your `package.json` will use the `^` caret matcher. (Although this may not matter thanks to shrinkwrap anyway…?) `npm shrinkwrap --dev` This will update the shrinkwrap file. **Note** You may have to remove extraneous packages, because Shrinkwrap will yet at you if there are packages installed but not listed in package.json. For some reason, this means, for me, that I always seem to have to run `rm -rf node_modules/npm-install-retry`. ¯\\_(ツ)_/¯