Create-react-app: npm test error on Windows: module <...> in the "setupFiles" option was not found

Created on 26 Feb 2017  路  11Comments  路  Source: facebook/create-react-app

There is a bug that happens with 0.9.1 (not 0.9.0).
Tested in on windows and Mac. on Mac everything seems to be ok. The attached error only happens when running on windows.
For now, i downgraded to 0.9.0 where all seems to be ok.
I've also tried to create a new app with create-react-app, When I run the test script, I get the same result.

Hope that can be fixed.

bug

up for grabs! bug

Most helpful comment

OK, fix should be out in 0.9.2.
Thanks to everyone!

Note to @Timer: I couldn't figure out how to make Lerna compare packages correctly in a branch (it said all packages updated) so I just published from folder.

All 11 comments

Have the same issue...

cc @Timer

We really need to set up AppVeyor.

I temporarily tagged 0.9.0 as latest so that at least create-react-app myapp gives you 0.9.0 for now.

This would still be a problem for anyone who uses caret semver for react-scripts, but we don't do this in new projects by default, so this gives us a few days to fix the issue.

Can you verify whether applying this diff to node_modules/react-scripts/scripts/test.js fixes the issue?

-  relativePath => path.posix.resolve(__dirname.replace(/[\\]+/g, path.posix.sep), '..', relativePath),
+  relativePath => path.resolve(__dirname, '..', relativePath),

Can confirm 0.9.0 was working correctly, after updating to 0.9.1 got this error

jest-test

@gaearon Suggested fix didn't work, still getting the same error.

I'm on Windows 10

Hmm, this seems like a different error, potentially due to npm bug (notice how a node module is missing). Could you delete node_modules, run npm install again, and retry? Thanks!

@gaearon Yep, that did it, works now 馃憤

Windows 8.1- fix with relativePath => path.resolve(__dirname, '..', relativePath), resolved issue.

OK, fix should be out in 0.9.2.
Thanks to everyone!

Note to @Timer: I couldn't figure out how to make Lerna compare packages correctly in a branch (it said all packages updated) so I just published from folder.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DaveLindberg picture DaveLindberg  路  3Comments

AlexeyRyashencev picture AlexeyRyashencev  路  3Comments

Evan-GK picture Evan-GK  路  3Comments

ap13p picture ap13p  路  3Comments

rdamian3 picture rdamian3  路  3Comments