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

ENOENT Error on npm3 #2

Closed
e-jigsaw opened this Issue Nov 6, 2015 · 8 comments

Comments

Projects
None yet
4 participants
@e-jigsaw
Copy link

e-jigsaw commented Nov 6, 2015

Hi

ava binary placed on (project root)/node_modules/.bin/ava on npm3.

var BIN = path.join(__dirname, 'node_modules', '.bin', 'ava');

raises ENOENT error. How to fix this?

Thanks

@vadimdemedes

This comment has been minimized.

Copy link
Member

vadimdemedes commented Nov 6, 2015

Hey,

This is caused by the way npm3 installs dependencies, it tries to put them as flat as possible. So, gulp-ava can't find ava executable.

Thanks for reporting this, fix will be submitted soon.

@vadimdemedes vadimdemedes added the bug label Nov 6, 2015

@kevva

This comment has been minimized.

Copy link
Contributor

kevva commented Nov 6, 2015

Doesn't all executables get put flat in .bin though?

@vadimdemedes

This comment has been minimized.

Copy link
Member

vadimdemedes commented Nov 6, 2015

@kevva Yes, they are, but gulp-ava looks for .bin inside its own node_modules - https://github.com/sindresorhus/gulp-ava/blob/master/index.js#L6

@kevva

This comment has been minimized.

Copy link
Contributor

kevva commented Nov 6, 2015

Oh, yeah...

@shinnn

This comment has been minimized.

Copy link
Collaborator

shinnn commented Nov 6, 2015

require.resolve would help us:

require.resolve('ava/cli.js');
@vadimdemedes

This comment has been minimized.

Copy link
Member

vadimdemedes commented Nov 6, 2015

@shinnn This is brilliant.

@kevva

This comment has been minimized.

Copy link
Contributor

kevva commented Nov 6, 2015

Yup, seems to work.

@e-jigsaw

This comment has been minimized.

Copy link

e-jigsaw commented Nov 6, 2015

Fantastic support!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment