Skip to content

consider using bundledDependencies instead of shrinkwrap #636

Closed

Description

@othiym23

Hi there! I'm one of the maintainers of npm, and I've been fielding enough requests for help getting ionic installed that it's become a reasonably significant percentage of our support traffic. One thing I've noticed is that ionic uses shrinkwrap. This is great for getting everybody using the same versions of all of Ionic's components, but it does make installing tough at times, because due to how shrinkwrap works, it ends up bypassing the npm cache and redownloading every package mentioned in the shrinkwrap each time npm install is run. If users have any issues with their network, or something gets sticky with npm's CDN, the whole install can fail, forcing them to start over again.

The most useful way to work around this would be to do what ember-cli and a few other more complicated packages do (including npm, which does this for bootstrapping reasons), and make sure all the dependencies are also included in bundleDependencies. This will result in one enormous package tarball to download and install, but it should actually be much more likely to be successful for the average user to install. This may not be an option if the resulting tarball is much over ~100MiB, but since an unpacked Ionic install only uses ~131MiB, it should be fine.

I know this might seem a little out of left field, but I do want to help the Ionic community, and this seems like the simplest thing you can do to make the experience much better for your users. There are some changes underway to the npm CLI that should address the same underlying issues with large, complex npm installs being fragile, but those are still in the design stage, and probably won't be ready for months. Let me know if there's anything I can do to help, if this sounds like something you think is worth doing. Thanks for your time!

Activity

  1. jbavari commented on Nov 4, 2015

    @jbavari

    @othiym23 thanks for bringing this up. @tlancina and I have been tossing the idea around of removing the shrinkwrapping.

    I'm tackling this right now, as we're having more issues with it.

    I do have a few questions for you:

    We have a few requirements on natively built modules. Should we include those into bundledDependencies to be included in the tarball? Or should those be excluded?

    For example, node-sass uses the C++ addons. If I bundle it on OSX, will Windows users pull that same version? Would I need to have a postinstall hook run npm rebuild?

    P.s:
    We are big fans of npm, thanks for the great support you and your team gives. ❤️

  2. self-assigned this
    on Nov 4, 2015
  3. calclavia commented on Nov 20, 2015

    @calclavia

    I'm guessing this issue is related to this? npm/npm#8196

  4. jmsims2 commented on Nov 23, 2015

    @jmsims2

    Is there a workaround outside of using npm? I can get cordova to install but ionic fails every time.

  5. mushishi78 commented on Nov 23, 2015

    @mushishi78

    @jmsims2 I cloned this repo locally and deleted the shrinkwrap file and then used npm install as a workaround.

  6. enw456 commented on Jul 6, 2018

    @enw456

    When I use the command this error appears npm ERR! Unexpected end of JSON input while parsing near '... "_ hasShrinkwrap": false', could you help me?

  7. locked as off topic and limited conversation to collaborators on Jul 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions