linux – util.promisify not a function node 8

Question:

The problem

vpotseluyko@localhost:~/PhpstormProjects/easta-api$ node -v
v8.0.0

Code:

const redis = require('redis');
const util = require('util');
const client = redis.createClient();
client.get = util.promisify(client.get);

Conclusion:

util.promisify is not a function

According to the documentation: https://nodejs.org/api/util.html#util_util_promisify_original

What have you been doing

rm -rf node_modules && npm i

Answer:

No need to install node 8 with nvm. The assembly goes wrong for some unknown reason. Place from the site.

sudo tar -C /usr/local --strip-components 1 -xJf Downloads/node-v8.0.0-linux-x64.tar.xz
Scroll to Top
AllEscort