Babel - Error: Cannot find module 'babel-runtime/helpers/typeof'
通过服务器的
的内容
1 2 3 4 5 6 7 8 | { "presets": ["react","es2015"], "plugins": [ "transform-class-properties", "transform-async-to-generator", "transform-runtime" ] } |
的相关内容
1 2 3 4 5 6 7 8 9 10 | "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", |
我还发现了其他一些提及,其中许多提及似乎都在这里-https://github.com/babel/babel/issues/2954
但是我在上面的链接中得到了404,确实看不到与
有什么想法吗?
结果是我需要安装
我遇到了这个错误,整夜都在寻找解决方案,最后只是删除了
当我遇到这个问题时,这是我的
安装babel-helpers为我解决了这个问题。
npm install-保存babel-helpers
好像他们已将所有问题都迁移到了另一个系统:https://phabricator.babeljs.io/T2954
使用CRA运行我的反应时遇到类似的问题。
以下是为我带来魅力的步骤;)。
1-
2-
3-
在我的情况下,我必须在webpack中排除node_modules:
1 2 3 4 5 6 | { test: /\\.m?js$/, include: [/svelte/], use: [babelLoader], exclude: /node_modules/ }, |
由于某种原因,没有它,它正在为另一个项目工作,而不是为新项目工作。
PS:我没有运气就尝试了上面的所有解决方案。
我或多或少有类似的错误
"找不到模块'babel-generator'。对如何调试它们一无所知。所以我最终决定
删除节点模块,在这种情况下,有时(windows'del'node_modules'命令不会删除node_modules),请手动删除它们。
npm缓存清理--force
npm缓存清除--force
npm修剪
npm安装
这种方法确实对我有用。
我有类似的问题:
1 | error in cannot find module 'babel-runtime/helpers/interop-require-default' |
我处理的方式是: