Skip to content

Commit 38fd5ea

Browse files
committed
chore(travis): blow away cached node_modules when npm-shrinkwrap.json changes
`npm install` blindly accepts the node_modules cache and doesn't verify if it matches requirements in the current npm-shrinkwrap.json. This means that if we are using travis cache and npm-shrinkwrap.json changes npm will keep on using the old dependencies, in spite of the guarantees that shrinkwrap claims to offer. angular#11110 (comment)
1 parent 7b66890 commit 38fd5ea

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ install:
4545
# Log HTTP requests
4646
- npm config set loglevel http
4747
- npm install -g npm@2.5
48+
- if [[ `md5 -q npm-shrinkwrap.json` == `md5 -q node_modules/npm-shrinkwrap.ng-hack.json` ]]; then echo "shrinkwrap changed. blowing away node_modules"; rm -rf node_modules; fi
4849
- time npm install
50+
- cp npm-shrinkwrap.json node_modules/npm-shrinkwrap.ng-hack.json
4951

5052
before_script:
5153
- mkdir -p $LOGS_DIR

0 commit comments

Comments
 (0)