jest: Node.js v8 AppVeyor build reports `projects.map is not a function`

With "jest": "^20.0.4" specified an AppVeyor build of a private repository using Node.js v8.0.0 fails:

TypeError: projects.map is not a function
    at Object.<anonymous> (C:\projects\the-project\node_modules\jest-cli\build\cli\runCLI.js:112:28)
    at Generator.next (<anonymous>)
    at step (C:\projects\the-project\node_modules\jest-cli\build\cli\runCLI.js:1:260)
    at C:\projects\the-project\node_modules\jest-cli\build\cli\runCLI.js:1:490
    at Promise (<anonymous>)
    at Object.<anonymous> (C:\projects\the-project\node_modules\jest-cli\build\cli\runCLI.js:1:171)
    at Object.module.exports [as runCLI] (C:\projects\the-project\node_modules\jest-cli\build\cli\runCLI.js:139:50)
    at Object.run (C:\projects\the-project\node_modules\jest\node_modules\jest-cli\build\cli\index.js:42:17)
    at Object.<anonymous> (C:\projects\the-project\node_modules\jest\node_modules\jest-cli\bin\jest.js:16:25)
    at Module._compile (module.js:569:30)

I’m seeing the same behavior locally on Windows 10. Node.js v6 in the same build passes on AppVeyor.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17 (1 by maintainers)

Most upvoted comments

@thymikee no actually… I looked at my yarn.lock which reported version 18! yarn upgrade jest fixed it. I believe I had perhaps run yarn upgrade jest-cli before! Thanks for pointing me in the right direction 😃

Worked out for me after doing yarn upgrade ject-cli and yarn upgrade jest and the running npm install -D jest jest-cli. Yarn is v0.27.5 Node is v6.10.2 Npm is v3.10.10

I have the same problem and I solved in the same way than @tylercrosse. Installing via npm instead yarn. I think yarn is downloading some dependency in wrong version but I didn’t discovered what. I tried to clean yarn cache and delete yarn.lock and it didn’t solve. I tried it with node v6.11.0 and v8.1.3. In both the same problem.

I ran into a similar problem. Jest ran fine via yarn global add, but failed when added locally via yarn. It weirdly worked when it was installed locally via npm npm -D jest. Maybe something weird with yarn or npm v5?