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

Error: Cannot find module '@babel/runtime/helpers/interopRequireWildcard' #56

Closed
pjaws opened this issue Sep 24, 2019 · 1 comment
Closed

Comments

@pjaws
Copy link

pjaws commented Sep 24, 2019

When running babel-node with this preset, I am encountering the following error and call stack:

internal/modules/cjs/loader.js:628
    throw err;
    ^

Error: Cannot find module '@babel/runtime/helpers/interopRequireWildcard'
Require stack:
- /Users/pauljaworski/Projects/ponto-api/src/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
    at Function.Module._load (internal/modules/cjs/loader.js:527:27)
    at Module.require (internal/modules/cjs/loader.js:683:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/Users/pauljaworski/Projects/ponto-api/src/index.js:3:31)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Module._compile (/Users/pauljaworski/Projects/ponto-api/node_modules/pirates/lib/index.js:99:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Object.newLoader [as .js] (/Users/pauljaworski/Projects/ponto-api/node_modules/pirates/lib/index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:643:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/Users/pauljaworski/Projects/ponto-api/src/index.js' ]
}

The issue goes away when I switch to @babel/preset-env, so I'm assuming it's coming from this preset. Happy to provide more information if needed. Thanks!

@lencioni
Copy link
Member

I believe this is happening because this preset uses @babel/plugin-transform-runtime which requires that you have @babel/runtime installed as a dependency in your application. There is a peerDependency on that package here that needs to be satisfied in your application:

"@babel/runtime": "^7.0.0"

You should see a warning about this when you npm install if you don't have that peerDependency requirement met.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants