{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/mongoose/issues/7060","repository_url":"https://api.github.com/repos/Automattic/mongoose","labels_url":"https://api.github.com/repos/Automattic/mongoose/issues/7060/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/mongoose/issues/7060/comments","events_url":"https://api.github.com/repos/Automattic/mongoose/issues/7060/events","html_url":"https://github.com/Automattic/mongoose/issues/7060","id":364711186,"node_id":"MDU6SXNzdWUzNjQ3MTExODY=","number":7060,"title":"TypeError: crypto.randomFillSync is not a function","user":{"login":"jwerre","id":747587,"node_id":"MDQ6VXNlcjc0NzU4Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/747587?v=4","gravatar_id":"","url":"https://api.github.com/users/jwerre","html_url":"https://github.com/jwerre","followers_url":"https://api.github.com/users/jwerre/followers","following_url":"https://api.github.com/users/jwerre/following{/other_user}","gists_url":"https://api.github.com/users/jwerre/gists{/gist_id}","starred_url":"https://api.github.com/users/jwerre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwerre/subscriptions","organizations_url":"https://api.github.com/users/jwerre/orgs","repos_url":"https://api.github.com/users/jwerre/repos","events_url":"https://api.github.com/users/jwerre/events{/privacy}","received_events_url":"https://api.github.com/users/jwerre/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-28T01:47:32Z","updated_at":"2018-09-28T09:45:43Z","closed_at":null,"author_association":"NONE","body":"I'm getting the following error:\r\n\r\n```\r\nTypeError: crypto.randomFillSync is not a function\r\n    at module.exports (node_modules/nanoid/random.js:5:10)\r\n    at module.exports (node_modules/nanoid/format.js:35:17)\r\n    at generate (node_modules/shortid/lib/generate.js:14:21)\r\n    at build (node_modules/shortid/lib/build.js:37:17)\r\n    at model.generate (node_modules/shortid/lib/index.js:53:10)\r\n    at SchemaString.SchemaType.getDefault (node_modules/mongoose/lib/schematype.js:644:27)\r\n    at model.Document.$__buildDoc (node_modules/mongoose/lib/document.js:280:22)\r\n    at model.Document (node_modules/mongoose/lib/document.js:73:20)\r\n    at model.Model (node_modules/mongoose/lib/model.js:56:12)\r\n    at new model (node_modules/mongoose/lib/model.js:3936:13)\r\n    at Object.createModel (node_modules/mongoose/lib/queryhelpers.js:75:10)\r\n    at completeMany (node_modules/mongoose/lib/query.js:1476:22)\r\n    at cb (node_modules/mongoose/lib/query.js:1337:13)\r\n    at handleCallback (node_modules/mongoose/node_modules/mongodb/lib/utils.js:120:56)\r\n    at node_modules/mongoose/node_modules/mongodb/lib/cursor.js:861:16\r\n    at handleCallback (node_modules/mongoose/node_modules/mongodb-core/lib/cursor.js:171:5)\r\n    at setCursorDeadAndNotified (node_modules/mongoose/node_modules/mongodb-core/lib/cursor.js:505:3)\r\n    at nextFunction (node_modules/mongoose/node_modules/mongodb-core/lib/cursor.js:660:7)\r\n    at Cursor.next [as _next] (node_modules/mongoose/node_modules/mongodb-core/lib/cursor.js:701:3)\r\n    at fetchDocs (node_modules/mongoose/node_modules/mongodb/lib/cursor.js:857:10)\r\n    at node_modules/mongoose/node_modules/mongodb/lib/cursor.js:880:7\r\n    at handleCallback (node_modules/mongoose/node_modules/mongodb-core/lib/cursor.js:171:5)\r\n    at nextFunction (node_modules/mongoose/node_modules/mongodb-core/lib/cursor.js:691:5)\r\n    at node_modules/mongoose/node_modules/mongodb-core/lib/cursor.js:602:7\r\n    at queryCallback (node_modules/mongoose/node_modules/mongodb-core/lib/cursor.js:232:18)\r\n    at node_modules/mongoose/node_modules/mongodb-core/lib/connection/pool.js:469:18\r\n    at _combinedTickCallback (internal/process/next_tick.js:73:7)\r\n    at process._tickDomainCallback (internal/process/next_tick.js:128:9)\r\n\r\n```\r\n\r\nLooks like `crypto.randomFillSync`  wasn't added until `v7.10.0`. I'm using Node `v6.10`. Which version of monoose is compatible with Node v6?\r\n\r\n**Please mention your node.js, mongoose and MongoDB version.**\r\nNode: v6.10.3\r\nMongoose: v4.13.15\r\nMongoDB: v3.4.14 "},"comment":{"url":"https://api.github.com/repos/Automattic/mongoose/issues/comments/425383192","html_url":"https://github.com/Automattic/mongoose/issues/7060#issuecomment-425383192","issue_url":"https://api.github.com/repos/Automattic/mongoose/issues/7060","id":425383192,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTM4MzE5Mg==","user":{"login":"lineus","id":6015453,"node_id":"MDQ6VXNlcjYwMTU0NTM=","avatar_url":"https://avatars3.githubusercontent.com/u/6015453?v=4","gravatar_id":"","url":"https://api.github.com/users/lineus","html_url":"https://github.com/lineus","followers_url":"https://api.github.com/users/lineus/followers","following_url":"https://api.github.com/users/lineus/following{/other_user}","gists_url":"https://api.github.com/users/lineus/gists{/gist_id}","starred_url":"https://api.github.com/users/lineus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lineus/subscriptions","organizations_url":"https://api.github.com/users/lineus/orgs","repos_url":"https://api.github.com/users/lineus/repos","events_url":"https://api.github.com/users/lineus/events{/privacy}","received_events_url":"https://api.github.com/users/lineus/received_events","type":"User","site_admin":false},"created_at":"2018-09-28T09:45:43Z","updated_at":"2018-09-28T09:45:43Z","author_association":"COLLABORATOR","body":"@jwerre Mongoose 4 and 5 both work on node 6, it's your dependency nanoid that is calling `crypto.randomFillSync()` and hence is incompatible with node 6. "}}
{"actor":{"display_login":"lineus"}}