Skip to content
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

npm test error on Windows: module <...> in the "setupFiles" option was not found #1645

Closed
sav931 opened this issue Feb 26, 2017 · 11 comments · Fixed by #1647
Closed

npm test error on Windows: module <...> in the "setupFiles" option was not found #1645

sav931 opened this issue Feb 26, 2017 · 11 comments · Fixed by #1647

Comments

@sav931
Copy link

sav931 commented Feb 26, 2017

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

@rotem925
Copy link

Have the same issue...

@gaearon
Copy link
Contributor

gaearon commented Feb 26, 2017

cc @Timer

@gaearon
Copy link
Contributor

gaearon commented Feb 26, 2017

We really need to set up AppVeyor.

@gaearon gaearon changed the title cannot run 0.9.1 npm test error on Windows: module <...> in the "setupFiles" option was not found Feb 26, 2017
@gaearon gaearon added this to the 0.9.2 milestone Feb 26, 2017
@gaearon
Copy link
Contributor

gaearon commented Feb 26, 2017

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.

@gaearon
Copy link
Contributor

gaearon commented Feb 26, 2017

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),

@berraknil
Copy link

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

@gaearon
Copy link
Contributor

gaearon commented Feb 26, 2017

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
Copy link
Contributor

gaearon commented Feb 26, 2017

Going to trust that #1647 works.

@berraknil
Copy link

@gaearon Yep, that did it, works now 👍

@noopnik
Copy link

noopnik commented Feb 26, 2017

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

@gaearon
Copy link
Contributor

gaearon commented Feb 26, 2017

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.

@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants