Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consider using bundledDependencies instead of shrinkwrap #636

Closed
othiym23 opened this issue Nov 4, 2015 · 5 comments
Closed

consider using bundledDependencies instead of shrinkwrap #636

othiym23 opened this issue Nov 4, 2015 · 5 comments

Comments

@othiym23
Copy link

othiym23 commented Nov 4, 2015

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!

@jbavari
Copy link

jbavari commented Nov 4, 2015

@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. ❤️

@calclavia
Copy link

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

@jmsims2
Copy link

jmsims2 commented Nov 23, 2015

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

@mushishi78
Copy link

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

@enw456
Copy link

enw456 commented Jul 6, 2018

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

@ionic-team ionic-team locked as off-topic and limited conversation to collaborators Jul 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants