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

Can't find modules that end with '.node' #353

Closed
johnhaley81 opened this issue May 5, 2015 · 6 comments
Closed

Can't find modules that end with '.node' #353

johnhaley81 opened this issue May 5, 2015 · 6 comments

Comments

@johnhaley81
Copy link

In NodeGit we include the native module via these lines. The key part is that we're using require('../build/Release/nodegit') and not including the '.node` at the end. This will break Jest when including this in any file.

johnhaley81 pushed a commit to nodegit/nodegit that referenced this issue May 5, 2015
Some things that override node's `require` (e.g. jest) might break when
including nodegit since. This is a workaround until they fix that.

I made an issue at jestjs/jest#353
@xcatliu
Copy link

xcatliu commented Jun 13, 2015

+1

@ghost
Copy link

ghost commented Jul 31, 2015

I have the same problem with using Jest with https://www.npmjs.com/package/fibers.

@ghost
Copy link

ghost commented Aug 5, 2015

Turns out that Jest has the option moduleFileExtensions where you can add the "node" extension. Just add this to your package.json.

"jest": {
  "moduleFileExtensions": ["js", "json", "node"]
}

I think that should be the default.

@cpojer
Copy link
Member

cpojer commented Nov 5, 2015

This will be fixed in the next release of jest, node was added as a default!

@shashankKeshava
Copy link

I'm still facing this is issue on jest v23.4.1. Adding node to moduleFileExtensions resolved the issue.

@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 11, 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

4 participants