Giter Club home page Giter Club logo

eb-fix-npm's Introduction

eb-fix-npm

This module installs an .ebextensions config file that will fix npm in various ways in AWS Elastic Beanstalk to make your deploys faster and more reliable.

TL;DR This module makes it possible to upgrade from Node 4 to Node 6 on Elastic Beanstalk and speeds up npm install by 95%.

Looking for even bigger savings? You might consider disabling npm altogether.

This module works by installing deployment hooks that perform setup and cleanup related to Elastic Beanstalk's use of npm:

  • Downgrade npm to npm 2 because npm 3 is too slow to install packages for EB (deploys will time out)
  • Cache Node modules between deploys
  • Only install (don't rebuild) Node modules on application deploy
  • Only rebuild (don't install) Node modules on configuration deploy (EB's script tries to both install and rebuild)
  • Actually rebuild Node modules on configuration deploy (EB's script uses the the wrong directory and so just aborts)
  • Remove npm temp files leftover by installing from shrinkwrap

The hooks expect that your Elastic Beanstalk application is using either platform version 3.1.0 (the latest) or the previous version, version 2.1.3.

Installation

  1. npm install eb-fix-npm --save-dev (see here for why --save-dev)
  2. Commit the .ebextensions file it creates.
  3. Deploy.

Modifying the .ebextensions file

This module will overwrite the file if/when it is updated.

Pull requests are welcome if you have some generally-useful modifications to suggest.

If you'd like to make modifications specific to your use case, you should uninstall this module after installing the .ebextensions file. Uninstallation won't take the file with it.

Acknowledgements

Some of the hooks are based on logic from https://github.com/kopurando/better-faster-elastic-beanstalk.

Release History

  • 1.2.5 Use the runtime Node version
  • 1.2.4 Set proper home directory
  • 1.2.3 Fix rebuild directory
  • 1.2.2 Misc fixes
  • 1.2.1 Use user's environment variables with npm
  • 1.2.0 Avoid unnecessarily installing/rebuilding Node modules
  • 1.1.0 Cache Node modules between deploys
  • 1.0.0 Initial commit

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.