【问题标题】:Serverless WARNING: Could not determine version of module babel-runtime无服务器警告:无法确定模块 babel-runtime 的版本
【发布时间】:2018-05-04 09:08:55
【问题描述】:

我正在运行 sls deploy 并收到以下警告,显示垃圾邮件很多行。

Serverless: WARNING: Could not determine version of module babel-runtime
Serverless: WARNING: Could not determine version of module babel-runtime
Serverless: WARNING: Could not determine version of module babel-runtime
Serverless: WARNING: Could not determine version of module babel-runtime
Serverless: WARNING: Could not determine version of module babel-runtime
...

这个警告的原因是什么,我应该担心吗?我该如何解决?

(如果我需要为此问题添加额外信息,请告诉我,我会立即编辑问题)。

【问题讨论】:

  • 这有什么更新吗?
  • 不是我仍然得到同样的错误

标签: serverless-framework serverless


【解决方案1】:

我在以下场景中遇到了同样的问题:

无服务器 + Webpack + Babel

在推荐的 webpack 配置中,开发依赖项被排除在外。 Babel-runtime(依赖于 babel,通常添加为 dev-dependency)也是一个 dev-dependency。

如果您将 babel-runtime 添加到您的常见依赖项中,现在 serverless(使用 webpack)将使用有关包的完整信息(在这种情况下为所需的版本)打包 babel-runtime。

yarn add babel-runtime

npm i babel-runtime

您可以避免这些警告。

【讨论】:

  • 哇好发现,早上第一件事就去测试!
  • npm 命令应该是 'npm i babel-runtime'。它不允许我提交编辑。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-11-14
  • 2022-12-13
  • 2016-12-06
  • 1970-01-01
  • 2019-01-14
  • 1970-01-01
相关资源
最近更新 更多