I am writing deployment scripts for my application on AWS. I created an AMI and it will run following scripts after boot.
cd $APP_DIR
git pull
npm install
npm start
It works alright until I updated some of my dependencies (e.g. React v0.12 -> v0.14). It looks like npm install
will not update the module that already installed.
Currently I have two options:
Add
rm -rf node_modules
beforenpm install
, but it is really expensive in booting phase.Every time existing dependency updated, create a new AMI. Obviously annoying because then I have extra dumb work on update launch-profile and auto-scaling settings.
Is there an easier way to update modules only when their versions changed in package.json
?