1

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 before npm 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?

Yu J.
  • 63
  • 1
  • 4

1 Answers1

0

You can use npm update to update all modules listed in package.json depending on caret (^), tilde (~) or asterisk (*) before their name.

Community
  • 1
  • 1
Kunal Kapadia
  • 3,223
  • 2
  • 28
  • 36