Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 9b26f17

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. #11110 (comment)
1 parent 2a67d47 commit 9b26f17

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ install:
4545
# Log HTTP requests
4646
- npm config set loglevel http
4747
- npm install -g npm@2.5
48-
- rm -rf node_modules
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
4949
- time npm install
50+
- cp npm-shrinkwrap.json node_modules/npm-shrinkwrap.ng-hack.json
5051

5152
before_script:
5253
- mkdir -p $LOGS_DIR

0 commit comments

Comments
 (0)