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

Unhandled rejection TypeError: Cannot read property 'F_OK' of undefined #9

Closed
irvingswiftj opened this issue Feb 24, 2017 · 6 comments

Comments

@irvingswiftj
Copy link

Since the last commit, I now have the following issue: Unhandled rejection TypeError: Cannot read property 'F_OK' of undefined

It seems that you can not rely on module 'fs' to have constants on all version on nodejs

@laggingreflex
Copy link
Collaborator

yup, seems so nodejs/node#8044

@mathisonian
Copy link
Owner

Ah okay, I was testing on node v6 as well. It looks like those are defined on the fs object itself in earlier versions.

@laggingreflex what do you think of changing

var constants = require('fs');

to

var fs = require('fs');
var constants = fs.constants || fs;

for compatibility?

@laggingreflex
Copy link
Collaborator

sounds good to me.

@Apollo2000
Copy link

Work's for me as well

@gegis
Copy link

gegis commented Feb 28, 2017

It's failing for me as well!
Unhandled rejection TypeError: Cannot read property 'F_OK' of undefined at fileNotExists (/.../node_modules/command-exists/lib/command-exists.js:12:34) at commandExistsUnix (/.../node_modules/command-exists/lib/command-exists.js:45:5) at commandExists (/.../node_modules/command-exists/lib/command-exists.js:115:5)

@mathisonian
Copy link
Owner

Fixed in #10 and patch pushed to npm. I've added travis to the repo as well

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

5 participants