Skip to content

ava --version returns unknown #2942

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

Closed
broofa opened this issue Jan 11, 2022 · 2 comments · Fixed by #2961
Closed

ava --version returns unknown #2942

broofa opened this issue Jan 11, 2022 · 2 comments · Fixed by #2961
Assignees
Labels
bug current functionality does not work as desired help wanted

Comments

@broofa
Copy link

broofa commented Jan 11, 2022

In a nutshell ...

$ npm install -D ava

$ npm ls ava
/Users/kieffer/codepen/cp/cpcompiler/processors/sass
`-- [email protected]

$ type ava
ava is hashed (./node_modules/.bin/ava)

$ ava --version
unknown
@novemberborn novemberborn changed the title ava --version = "unknown" ava --version returns unknown Jan 13, 2022
@novemberborn
Copy link
Member

This used to work with v3, how strange!

@novemberborn novemberborn added bug current functionality does not work as desired help wanted and removed needs triage labels Jan 13, 2022
@jopemachine
Copy link

jopemachine commented Jan 27, 2022

I think it is an issue of yargs.

In this code, yargs's platform-shims/esm.mjs takes different value on mainFilename with platform-shims/cjs.ts.

And in my thought, because this line stores the wrong value in the mainFilename in ESM, yargs cannot find ava's package.json in their kPkgUp function.

Maybe, I think this line needs to be changed like below or something.

const mainFilename = __dirname.substring(0, __dirname.lastIndexOf('node_modules'));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug current functionality does not work as desired help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants