2

I have the same problem as this "duplicate" question. I made an empty project and installed only jest. Then I created one sample test file. When I run jest, it gives an error:

 FAIL  __tests__/test.test.js
● Test suite failed to run

TypeError: Path must be a string. Received undefined

  at assertPath (path.js:28:11)
  at Object.relative (path.js:1254:5)

I have the latest version of npm, and the jest version is 21.2.1. Mac. Any ideas what might be causing it?

EDIT: version 20.0.4 works just fine, so I go with it for now.

Simoroshka
  • 339
  • 1
  • 7
  • 18
  • Possible duplicate of [Jest TypeError: Path must be a string. Received undefined](https://stackoverflow.com/questions/46220674/jest-typeerror-path-must-be-a-string-received-undefined) – floriangosse Oct 07 '17 at 08:41
  • downgrading to 20.0.4 didn't work for me :( – sergioviniciuss Nov 04 '17 at 21:28
  • Sorry to hear it... did you try it on an empty project? If it works, then deleting package-lock and node_modules and then doing npm install again could help. – Simoroshka Nov 06 '17 at 08:14

0 Answers0