Babel - Error: Cannot find module 'babel-runtime/helpers/typeof'

jerome picture jerome · Dec 16, 2015 · Viewed 26.9k times · Source

Transpiling via gulp-babel for the server and browserify with babelify for the client - using async and await in my code. These features seem to transform just fine, but... Error: Cannot find module 'babel-runtime/helpers/typeof'

Contents of .babelrc

{
  "presets": ["react", "es2015"],
  "plugins": [
    "transform-class-properties",
    "transform-async-to-generator",
    "transform-runtime"
  ]
}

Relevant contents of package.json

"babel-core": "6.3.13",
"babel-eslint": "4.1.6",
"babel-plugin-transform-async-to-generator": "6.3.13",
"babel-plugin-transform-class-properties": "6.3.13",
"babel-plugin-transform-runtime": "6.3.13",
"babel-preset-es2015": "6.3.13",
"babel-preset-react": "6.3.13",
"babelify": "7.2.0",
"browserify": "12.0.1",
"gulp-babel": "6.1.0",

I have found a few other mentions of this, many of which seem to lead here - https://github.com/babel/babel/issues/2954

But I am getting a 404 at the link above and indeed cannot see any issues related to babel - https://github.com/babel/babel/issues redirects to https://github.com/babel/babel/pulls

Any ideas?

Answer

jerome picture jerome · Dec 16, 2015

Turns out I needed to take the install of babel-runtime, which I thought had been deprecated with the release of Babel v6.