10

我正在运行 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
...

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

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

4

1 回答 1

15

在以下情况下,我遇到了同样的问题:

无服务器 + Webpack + Babel

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

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

yarn add babel-runtime

或者

npm i babel-runtime

您可以避免这些警告。

于 2018-01-26T21:32:56.273 回答