RollupJS `resolve failed: Error: Cannot find module 'babel-runtime'`
RollupJS `resolve failed: Error: Cannot find module 'babel-runtime'`
汇总错误示例
说明汇总的(可能的)问题。
我错过了什么吗?这是一个配置最少的项目
重现我的"problem"成运行。这个问题似乎只是无关紧要的
不影响包本身的命令行日志记录;即捆绑包是
正确准确地创建。
此项目显示输出:
$ ./node_modules/.bin/rollup -c rollup.js
node_modules/nan
resolve failed: { Error: Cannot find module 'babel-runtime'
at Function.Module._resolveFilename (module.js:472:15)
at Function.requireRelative.resolve (/Users/jkalis/Pro/QL/WebCore/luxui/rollup-testing/node_modules/require-relative/index.js:30:17)
at resolve (/Users/jkalis/Pro/QL/WebCore/luxui/rollup-testing/node_modules/modify-babel-preset/lib/serialize.js:25:26)
at findAndRemove (/Users/jkalis/Pro/QL/WebCore/luxui/rollup-testing/node_modules/modify-babel-preset/lib/serialize.js:67:11)
at /Users/jkalis/Pro/QL/WebCore/luxui/rollup-testing/node_modules/modify-babel-preset/lib/serialize.js:111:13
at Array.map (native)
at loadPreset (/Users/jkalis/Pro/QL/WebCore/luxui/rollup-testing/node_modules/modify-babel-preset/lib/serialize.js:103:29)
at module.exports (/Users/jkalis/Pro/QL/WebCore/luxui/rollup-testing/node_modules/modify-babel-preset/index.js:97:19)
at Object.<anonymous> (/Users/jkalis/Pro/QL/WebCore/luxui/rollup-testing/node_modules/babel-preset-es2015-rollup/index.js:3:18)
at Module._compile (module.js:573:32) code: 'MODULE_NOT_FOUND' } babel-runtime
重现此命令的命令是:
npm run bundle
,或
./node_modules/.bin/rollup -c rollup.js
在其他项目中,我遇到了类似的问题,需要额外解决 "failures"
似乎不影响捆绑包本身。这是很容易修复的东西吗?
我创建了一个 Git 存储库 - https://github.com/kalisjoshua/rollup-error-example - 它展示了这种行为。
我错过了什么?
github 上显示如何重现错误的 repo 显示了正在使用的 babel-preset-es2015-rollup 版本 1.2.0。我在 github 上找到了以下内容:
- https://github.com/rollup/rollup/issues/1141
- https://github.com/rollup/babel-preset-es2015-rollup/issues/18
看来babel-preset-es2015-rollup包只需要更新到最新即可,我试过后,错误不再出现
diff --git a/package.json b/package.json
index b1f4325..d5251fd 100644
--- a/package.json
+++ b/package.json
@@ -12,7 +12,7 @@
"license": "MIT",
"dependencies": {
"babel-cli": "^6.18.0",
- "babel-preset-es2015-rollup": "^1.2.0",
+ "babel-preset-es2015-rollup": "^3.0.0",
"rollup": "^0.36.4",
"rollup-plugin-babel": "^2.6.1"
}
汇总错误示例
说明汇总的(可能的)问题。
我错过了什么吗?这是一个配置最少的项目 重现我的"problem"成运行。这个问题似乎只是无关紧要的 不影响包本身的命令行日志记录;即捆绑包是 正确准确地创建。
此项目显示输出:
$ ./node_modules/.bin/rollup -c rollup.js
node_modules/nan
resolve failed: { Error: Cannot find module 'babel-runtime'
at Function.Module._resolveFilename (module.js:472:15)
at Function.requireRelative.resolve (/Users/jkalis/Pro/QL/WebCore/luxui/rollup-testing/node_modules/require-relative/index.js:30:17)
at resolve (/Users/jkalis/Pro/QL/WebCore/luxui/rollup-testing/node_modules/modify-babel-preset/lib/serialize.js:25:26)
at findAndRemove (/Users/jkalis/Pro/QL/WebCore/luxui/rollup-testing/node_modules/modify-babel-preset/lib/serialize.js:67:11)
at /Users/jkalis/Pro/QL/WebCore/luxui/rollup-testing/node_modules/modify-babel-preset/lib/serialize.js:111:13
at Array.map (native)
at loadPreset (/Users/jkalis/Pro/QL/WebCore/luxui/rollup-testing/node_modules/modify-babel-preset/lib/serialize.js:103:29)
at module.exports (/Users/jkalis/Pro/QL/WebCore/luxui/rollup-testing/node_modules/modify-babel-preset/index.js:97:19)
at Object.<anonymous> (/Users/jkalis/Pro/QL/WebCore/luxui/rollup-testing/node_modules/babel-preset-es2015-rollup/index.js:3:18)
at Module._compile (module.js:573:32) code: 'MODULE_NOT_FOUND' } babel-runtime
重现此命令的命令是:
npm run bundle
,或./node_modules/.bin/rollup -c rollup.js
在其他项目中,我遇到了类似的问题,需要额外解决 "failures" 似乎不影响捆绑包本身。这是很容易修复的东西吗?
我创建了一个 Git 存储库 - https://github.com/kalisjoshua/rollup-error-example - 它展示了这种行为。
我错过了什么?
github 上显示如何重现错误的 repo 显示了正在使用的 babel-preset-es2015-rollup 版本 1.2.0。我在 github 上找到了以下内容:
- https://github.com/rollup/rollup/issues/1141
- https://github.com/rollup/babel-preset-es2015-rollup/issues/18
看来babel-preset-es2015-rollup包只需要更新到最新即可,我试过后,错误不再出现
diff --git a/package.json b/package.json
index b1f4325..d5251fd 100644
--- a/package.json
+++ b/package.json
@@ -12,7 +12,7 @@
"license": "MIT",
"dependencies": {
"babel-cli": "^6.18.0",
- "babel-preset-es2015-rollup": "^1.2.0",
+ "babel-preset-es2015-rollup": "^3.0.0",
"rollup": "^0.36.4",
"rollup-plugin-babel": "^2.6.1"
}