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

Unsupported node version #730

Closed
Kureev opened this issue Feb 21, 2016 · 5 comments
Closed

Unsupported node version #730

Kureev opened this issue Feb 21, 2016 · 5 comments

Comments

@Kureev
Copy link

Kureev commented Feb 21, 2016

Hi @cpojer!

I'm trying to migrate our rnpm tests to Jest, but I have a weird exception here:

 FAIL  test/android/findPackageClassName.spec.js
● Runtime Error
Error: Unsupported Node version: 5.6.0
    at Object.eval (/Users/xamd/Projects/rnpm/node_modules/mock-fs/lib/index.js:36:9)
    at Loader._execModule (/Users/xamd/Projects/rnpm/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:206:17)
    at Loader.requireModule (/Users/xamd/Projects/rnpm/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:760:14)
    at Loader._generateMock (/Users/xamd/Projects/rnpm/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:243:34)
    at Loader.requireMock (/Users/xamd/Projects/rnpm/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:677:45)
    at Loader.requireModuleOrMock (/Users/xamd/Projects/rnpm/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:788:19)
    at Object.eval (/Users/xamd/Projects/rnpm/test/android/findPackageClassName.spec.js:4:16)
    at Loader._execModule (/Users/xamd/Projects/rnpm/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:206:17)
    at Loader.requireModule (/Users/xamd/Projects/rnpm/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:760:14)
    at jasmine1 (/Users/xamd/Projects/rnpm/node_modules/jest-cli/src/testRunners/jasmine/jasmine1.js:233:16)
    at /Users/xamd/Projects/rnpm/node_modules/jest-cli/src/TestRunner.js:261:14

Looks like if I use mock-fs from Jest tests, semver.satisfies returns undefined(???). If I run the same code from REPL, it works.

@Kureev
Copy link
Author

Kureev commented Feb 21, 2016

Well, looks like jest.autoMockOff(); solves the problem, but jest.dontMock('mock-fs'); has no effect. Can you please explain me why?

@cpojer
Copy link
Member

cpojer commented Feb 22, 2016

Hey! Are you using npm3? That might be it. I'm fixing this for the final 0.9.0 release.

@Kureev
Copy link
Author

Kureev commented Feb 22, 2016

Yep, 3.6.0. Let me know if I can assist with this one (or if you need more input from my side) 😉

@cpojer
Copy link
Member

cpojer commented Feb 22, 2016

If you could try whether #732 solves your issue, that would be fantastic. I believe it does, so I'm gonna close out this issue but if it doesn't, I'll reopen and fix it :)

@cpojer cpojer closed this as completed Feb 22, 2016
ghost pushed a commit that referenced this issue Feb 22, 2016
Summary:This fixes unmock resolution for node_modules when using npm3. The way this is solved is by checking whether the parent dependency is unmocked and both modules are within a `node_modules` folder.

This has taken a while, mainly because it required #599 to be merged. I also added some more caching that makes test runs even faster. The react-native test suite now completes in about 6s (down from 7.5-8s). There might be more in the near future ;)

This fixes #554, #730, facebook/react#5183, facebook/relay#832 and will be part of 0.9.0. I'll publish 0.9.0-fb3 today with this fix.
Closes #732

Differential Revision: D2959610

fb-gh-sync-id: c374b7a2bcdfddf768905356a08948d9156eb028
shipit-source-id: c374b7a2bcdfddf768905356a08948d9156eb028
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants