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

Commit 6734341

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) With this change, we will blow away the node_modules directory if the shrinkwrap changes compared to the one used to populate node_modules.
1 parent 7b66890 commit 6734341

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+
- diff -q npm-shrinkwrap.json node_modules/npm-shrinkwrap.cached.json; if [[ $? -ne 0 ]]; then echo "Blowing away node_modules"; rm -rf node_modules; fi
4849
- time npm install
50+
- cp npm-shrinkwrap.json node_modules/npm-shrinkwrap.cached.json
4951

5052
before_script:
5153
- mkdir -p $LOGS_DIR

0 commit comments

Comments
 (0)