{"action":"created","issue":{"url":"https://api.github.com/repos/travis-ci/travis-ci/issues/3758","labels_url":"https://api.github.com/repos/travis-ci/travis-ci/issues/3758/labels{/name}","comments_url":"https://api.github.com/repos/travis-ci/travis-ci/issues/3758/comments","events_url":"https://api.github.com/repos/travis-ci/travis-ci/issues/3758/events","html_url":"https://github.com/travis-ci/travis-ci/issues/3758","id":70577680,"number":3758,"title":"caching node_modules and wrong dependency version","user":{"login":"deepsweet","id":266822,"avatar_url":"https://avatars.githubusercontent.com/u/266822?v=3","gravatar_id":"","url":"https://api.github.com/users/deepsweet","html_url":"https://github.com/deepsweet","followers_url":"https://api.github.com/users/deepsweet/followers","following_url":"https://api.github.com/users/deepsweet/following{/other_user}","gists_url":"https://api.github.com/users/deepsweet/gists{/gist_id}","starred_url":"https://api.github.com/users/deepsweet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deepsweet/subscriptions","organizations_url":"https://api.github.com/users/deepsweet/orgs","repos_url":"https://api.github.com/users/deepsweet/repos","events_url":"https://api.github.com/users/deepsweet/events{/privacy}","received_events_url":"https://api.github.com/users/deepsweet/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/travis-ci/travis-ci/labels/awaiting-followup","name":"awaiting-followup","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-24T03:46:02Z","updated_at":"2015-07-27T15:24:45Z","closed_at":null,"body":"failed build:\r\n\r\n```yaml\r\ncache:\r\n  directories:\r\n    - node_modules\r\n```\r\nhttps://s3.amazonaws.com/archive.travis-ci.org/jobs/59823548/log.txt\r\n\r\nstrange error about babel/babel-runtime versions mistamatch: there was `babel-runtime@5.0` there before and it was cached buy travis, but in this commit it was hanged to `@5.1`. and it looks like travis for some reason took `@5.0` from cache instead of fresh installing `@5.1`.\r\n\r\nwith disabled cache `@5.1` was installed as expected and all is ok:\r\n\r\n```yaml\r\n# cache:\r\n#   directories:\r\n#     - node_modules\r\n```\r\nhttps://s3.amazonaws.com/archive.travis-ci.org/jobs/59823990/log.txt"},"comment":{"url":"https://api.github.com/repos/travis-ci/travis-ci/issues/comments/125243767","html_url":"https://github.com/travis-ci/travis-ci/issues/3758#issuecomment-125243767","issue_url":"https://api.github.com/repos/travis-ci/travis-ci/issues/3758","id":125243767,"user":{"login":"vladikoff","id":128755,"avatar_url":"https://avatars.githubusercontent.com/u/128755?v=3","gravatar_id":"","url":"https://api.github.com/users/vladikoff","html_url":"https://github.com/vladikoff","followers_url":"https://api.github.com/users/vladikoff/followers","following_url":"https://api.github.com/users/vladikoff/following{/other_user}","gists_url":"https://api.github.com/users/vladikoff/gists{/gist_id}","starred_url":"https://api.github.com/users/vladikoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladikoff/subscriptions","organizations_url":"https://api.github.com/users/vladikoff/orgs","repos_url":"https://api.github.com/users/vladikoff/repos","events_url":"https://api.github.com/users/vladikoff/events{/privacy}","received_events_url":"https://api.github.com/users/vladikoff/received_events","type":"User","site_admin":false},"created_at":"2015-07-27T15:24:45Z","updated_at":"2015-07-27T15:24:45Z","body":"@BanzaiMan there seems to be a problem with caching node_modules. \r\n\r\nWhen we bump the versions in package.json we still get old modules in the node_modules directory.\r\nThis is not default npm behaviour and is confusing why it is happening on Travis. \r\n\r\nRef: https://github.com/mozilla/fxa-content-server/issues/2828\r\n\r\nOutside of travis if I bump a dependency in package.json and run `npm install` right away - npm will force installation of a new version.\r\n\r\n```json\r\n➜  npmtest  npm list\r\nnpmtest@1.0.0 /Users/vladikoff/tmp/npmtest\r\n└─┬ grunt@0.4.0                      <<<<<<----- this is 0.4.0\r\n  ├── async@0.1.22\r\n  ├── coffee-script@1.3.3\r\n  ├── colors@0.6.2\r\n  ├── dateformat@1.0.2-1.2.3\r\n  ├── eventemitter2@0.4.14\r\n  ├─┬ findup-sync@0.1.3\r\n  │ ├─┬ glob@3.2.11\r\n  │ │ ├── inherits@2.0.1\r\n  │ │ └─┬ minimatch@0.3.0\r\n  │ │   ├── lru-cache@2.6.5\r\n  │ │   └── sigmund@1.0.1\r\n  │ └── lodash@2.4.2\r\n  ├─┬ glob@3.1.21\r\n  │ ├── graceful-fs@1.2.3\r\n  │ └── inherits@1.0.0\r\n  ├── hooker@0.2.3\r\n  ├── iconv-lite@0.2.11\r\n  ├─┬ js-yaml@1.0.3\r\n  │ └─┬ argparse@0.1.16\r\n  │   ├── underscore@1.7.0\r\n  │   └── underscore.string@2.4.0\r\n  ├── lodash@0.9.2\r\n  ├─┬ minimatch@0.2.14\r\n  │ ├── lru-cache@2.6.5\r\n  │ └── sigmund@1.0.1\r\n  ├─┬ nopt@1.0.10\r\n  │ └── abbrev@1.0.7\r\n  ├─┬ rimraf@2.0.3\r\n  │ └── graceful-fs@1.1.14\r\n  ├── underscore.string@2.2.1\r\n  └── which@1.0.9\r\n// UPDATE PACKAGE.json here and change to grunt@0.4.3\r\n// RUN npm install:\r\n➜  npmtest  npm i\r\nnpm WARN package.json npmtest@1.0.0 No description\r\nnpm WARN package.json npmtest@1.0.0 No repository field.\r\nnpm WARN package.json npmtest@1.0.0 No README data\r\ngrunt@0.4.3 node_modules/grunt        <<<<----- this is not 0.4.3, i did not have to do anything, except changing package.json\r\n├── which@1.0.9\r\n├── dateformat@1.0.2-1.2.3\r\n├── eventemitter2@0.4.14\r\n├── getobject@0.1.0\r\n├── rimraf@2.2.8\r\n├── colors@0.6.2\r\n├── grunt-legacy-util@0.1.2\r\n├── async@0.1.22\r\n├── hooker@0.2.3\r\n├── exit@0.1.2\r\n├── lodash@0.9.2\r\n├── coffee-script@1.3.3\r\n├── underscore.string@2.2.1\r\n├── iconv-lite@0.2.11\r\n├── nopt@1.0.10 (abbrev@1.0.7)\r\n├── minimatch@0.2.14 (sigmund@1.0.1, lru-cache@2.6.5)\r\n├── glob@3.1.21 (inherits@1.0.0, graceful-fs@1.2.3)\r\n├── findup-sync@0.1.3 (lodash@2.4.2, glob@3.2.11)\r\n└── js-yaml@2.0.5 (esprima@1.0.4, argparse@0.1.16)\r\n```\r\n\r\nClearing caches works but it is a wrong fix for this.\r\n"}}