You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
consider using bundledDependencies instead of shrinkwrap #636
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!
@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. ❤️
Activity
jbavari commentedon 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
postinstallhook runnpm rebuild?P.s:
We are big fans of npm, thanks for the great support you and your team gives. ❤️
calclavia commentedon Nov 20, 2015
I'm guessing this issue is related to this? npm/npm#8196
jmsims2 commentedon Nov 23, 2015
Is there a workaround outside of using npm? I can get cordova to install but ionic fails every time.
mushishi78 commentedon Nov 23, 2015
@jmsims2 I cloned this repo locally and deleted the shrinkwrap file and then used npm install as a workaround.
enw456 commentedon 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?