{"action":"created","issue":{"url":"https://api.github.com/repos/nodkz/mongodb-memory-server/issues/101","repository_url":"https://api.github.com/repos/nodkz/mongodb-memory-server","labels_url":"https://api.github.com/repos/nodkz/mongodb-memory-server/issues/101/labels{/name}","comments_url":"https://api.github.com/repos/nodkz/mongodb-memory-server/issues/101/comments","events_url":"https://api.github.com/repos/nodkz/mongodb-memory-server/issues/101/events","html_url":"https://github.com/nodkz/mongodb-memory-server/issues/101","id":378857816,"node_id":"MDU6SXNzdWUzNzg4NTc4MTY=","number":101,"title":"Download path inconsistency between post-install and defaults.","user":{"login":"akateiva","id":9199087,"node_id":"MDQ6VXNlcjkxOTkwODc=","avatar_url":"https://avatars1.githubusercontent.com/u/9199087?v=4","gravatar_id":"","url":"https://api.github.com/users/akateiva","html_url":"https://github.com/akateiva","followers_url":"https://api.github.com/users/akateiva/followers","following_url":"https://api.github.com/users/akateiva/following{/other_user}","gists_url":"https://api.github.com/users/akateiva/gists{/gist_id}","starred_url":"https://api.github.com/users/akateiva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akateiva/subscriptions","organizations_url":"https://api.github.com/users/akateiva/orgs","repos_url":"https://api.github.com/users/akateiva/repos","events_url":"https://api.github.com/users/akateiva/events{/privacy}","received_events_url":"https://api.github.com/users/akateiva/received_events","type":"User","site_admin":false},"labels":[{"id":1116889691,"node_id":"MDU6TGFiZWwxMTE2ODg5Njkx","url":"https://api.github.com/repos/nodkz/mongodb-memory-server/labels/released","name":"released","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-11-08T18:19:10Z","updated_at":"2018-11-12T16:38:49Z","closed_at":"2018-11-12T16:15:06Z","author_association":"NONE","body":"Currently, the post-install script downloads the binaries to `/node_modules/mongodb-memory-server/node_modules/.cache/mongodb-memory-server/mongodb-binaries/latest/mongod`, which I believe is due to the cwd being set to /node_modules/mongodb-memory-server when post-install is run. At runtime, the binaries are downloaded anew to `/node_modules/.cache/mongodb-memory-server/mongodb-binaries`. Perhaps the easiest fix for this would be checking both directories in MongoBinary.js ?\r\n\r\nTo reproduce:\r\n```\r\ndocker run -it --rm node:11 /bin/bash\r\nroot@444a1d59d65f:/# npm init --yes\r\nWrote to /package.json:\r\n\r\n{\r\n  \"name\": \"\",\r\n  \"version\": \"1.0.0\",\r\n  \"description\": \"\",\r\n  \"main\": \"index.js\",\r\n  \"directories\": {\r\n    \"lib\": \"lib\"\r\n  },\r\n  \"scripts\": {\r\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\r\n  },\r\n  \"keywords\": [],\r\n  \"author\": \"\",\r\n  \"license\": \"ISC\"\r\n}\r\n\r\n\r\nroot@444a1d59d65f:/# npm install --save-dev mongodb-memory-server\r\n\r\n> mongodb-memory-server@2.7.0 postinstall /node_modules/mongodb-memory-server\r\n> node ./postinstall.js\r\n\r\nmongodb-memory-server: checking MongoDB binaries cache...\r\nmongodb-memory-server: binary path is /node_modules/mongodb-memory-server/node_modules/.cache/mongodb-memory-server/mongodb-binaries/latest/mongod\r\nnpm notice created a lockfile as package-lock.json. You should commit this file.\r\nnpm WARN mongodb-memory-server@2.7.0 requires a peer of mongodb@>= 3.0 but none is installed. You must install peer dependencies yourself.\r\nnpm WARN @1.0.0 No description\r\nnpm WARN @1.0.0 No repository field.\r\n\r\n+ mongodb-memory-server@2.7.0\r\nadded 81 packages from 48 contributors and audited 166 packages in 35.706s\r\nfound 0 vulnerabilities\r\n\r\nroot@444a1d59d65f:/# node\r\n> const path = require('path');\r\nundefined\r\n> const findCacheDir = require('find-cache-dir');\r\nundefined\r\n> path.resolve(findCacheDir({ name: 'mongodb-memory-server' }), 'mongodb-binaries');\r\n'/node_modules/.cache/mongodb-memory-server/mongodb-binaries'\r\n```"},"comment":{"url":"https://api.github.com/repos/nodkz/mongodb-memory-server/issues/comments/437947664","html_url":"https://github.com/nodkz/mongodb-memory-server/issues/101#issuecomment-437947664","issue_url":"https://api.github.com/repos/nodkz/mongodb-memory-server/issues/101","id":437947664,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzk0NzY2NA==","user":{"login":"AJRdev","id":11077566,"node_id":"MDQ6VXNlcjExMDc3NTY2","avatar_url":"https://avatars1.githubusercontent.com/u/11077566?v=4","gravatar_id":"","url":"https://api.github.com/users/AJRdev","html_url":"https://github.com/AJRdev","followers_url":"https://api.github.com/users/AJRdev/followers","following_url":"https://api.github.com/users/AJRdev/following{/other_user}","gists_url":"https://api.github.com/users/AJRdev/gists{/gist_id}","starred_url":"https://api.github.com/users/AJRdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AJRdev/subscriptions","organizations_url":"https://api.github.com/users/AJRdev/orgs","repos_url":"https://api.github.com/users/AJRdev/repos","events_url":"https://api.github.com/users/AJRdev/events{/privacy}","received_events_url":"https://api.github.com/users/AJRdev/received_events","type":"User","site_admin":false},"created_at":"2018-11-12T16:38:49Z","updated_at":"2018-11-12T16:38:49Z","author_association":"COLLABORATOR","body":"@guillaumervls Nice fix ;)"}}
{"actor":{"display_login":"AJRdev"}}