Meteor-node-stubs installed, but still not seeing the 'util' function 'promisify'

I have a Meteor project that has worked just fine, and has had meteor-node-stubs. But upon recently adding the package crypto-random-string, I am getting this error: Uncaught TypeError: promisify is not a function. The app won’t start at all.

Okay, so promisify is right there in the package: https://github.com/sindresorhus/crypto-random-string/blob/3f1ec4cc6b41e27294506be6442b83369dbdcb58/index.js#L5

But I can’t figure it out. meteor-node-stubs is in my project. It’s been working fine. promisify should be available on the client. I’ve removed node_modules and re-installed, and tried anything else I can think of.

Is this a problem anybody else has seen? Is this a Meteor 2.0 thing? Help.

I am getting my Meteor app running again by modifying the require of crypto-random-string/index.js
from
const {promisify} = require('util');
to
const promisify = require('util.promisify');

Just sharing in case it helps others. I already use patch-package for 3 other npm packages, so I’m adding a patch for this one and moving on. Not that it makes sense to me!

1 Like

Is there another way to patch this wo editing the src code for libs?
if not, where exactly are the lib files stored? Thanks!