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

泪湿孤枕 提交于 2020-01-02 04:55:11

问题


I'm running sls deploy and getting the following warning that spams many lines.

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
...

What is the cause of this warning, should I be concerned? How do I fix it?

(If I need to add extra information to this question, please let me know and I'll edit the question right away).


回答1:


I'm having the same issue in the following scenario:

Serverless + Webpack + Babel

In recommended webpack config, dev-dependencies are excluded. Babel-runtime (depends of babel, normally added as dev-dependency) is a dev-dependency too.

If you add babel-runtime to your common dependecies, now serverless (using webpack) will package babel-runtime with full information about the package (in this case, the version required).

yarn add babel-runtime

or

npm i babel-runtime

You can avoid these warnings.



来源:https://stackoverflow.com/questions/47404025/serverless-warning-could-not-determine-version-of-module-babel-runtime

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!