dylang / shortid

Short id generator. Url-friendly. Non-predictable. Cluster-compatible.

Home Page:https://www.npmjs.org/package/shortid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to generate shortid on node v6.11.1

sean-medullan opened this issue · comments

The following error is generated:

TypeError: crypto.randomFillSync is not a function
    at module.exports (./node_modules/nanoid/random.js:5:10)
    at module.exports (./node_modules/nanoid/format.js:35:17)
    at generate (./node_modules/shortid/lib/generate.js:14:21)
    at build (./node_modules/shortid/lib/build.js:37:17)
    at Function.generate (./node_modules/shortid/lib/index.js:53:10)
    at Object.<anonymous> (./x.js:2:37)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)

I see that nanoid published recently and they have an open issue on that side.

Will be fixed in the next few days.

Quick solution: update to >6.13

The fix was released in nanoid 1.2.5. Update your dependencies.