0

The ava command is not in my path. I can not run it from in the project directory that contains some AVA tests.

My npm test command of my project is set to ava tests/*.js --verbose, and can somehow call the ava command from the same location in the terminal.

My questions is: how is npm calling the ava command? I suspect it is calling it from the project's node_modules folder, but I could not find it in any source.

If anyone can explain how this happens, or better yet show me the source, I would really appreciate it.

tehp
  • 5,018
  • 1
  • 24
  • 31

1 Answers1

2

When you run the npm run [script] or in this case npm test, NPM is smart enough to try to execute the binary from the node_modules/.bin directory first.

tehp
  • 5,018
  • 1
  • 24
  • 31
Felix Fong
  • 969
  • 1
  • 8
  • 21