Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: util.promisify is not a function #7

Open
tgrrr opened this issue Aug 20, 2018 · 3 comments
Open

TypeError: util.promisify is not a function #7

tgrrr opened this issue Aug 20, 2018 · 3 comments

Comments

@tgrrr
Copy link

tgrrr commented Aug 20, 2018

I'm having "fun" getting this package to initially load

// App.js
const branch = require('git-branch');
console.log('gitBranch', branch);

TypeError: util.promisify is not a function
(anonymous function)

  3 | const fs = require('fs');
  4 | const util = require('util');
  5 | const find = require('findup-sync');
> 6 | const readFile = util.promisify(fs.readFile);

tested with:
node v8.11.4 and v.9.3.0

@jonschlinkert
Copy link
Owner

Hmm, strange. here are the docs for util.promisify(). Can you provide more information about your environment? Are you using electron? etc...

@tgrrr
Copy link
Author

tgrrr commented Aug 21, 2018

After it didn't work, I isolated it with a new create-react-app

{
  "name": "create-react-app-demo",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^16.4.1",
    "react-dom": "^16.4.1",
    "react-scripts": "1.1.4"
  },

I've checked the docs. The error is sometimes based on node < 8. But I'm not using that in this case.

@nikmartin
Copy link

what is the output of node -v on your system?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants