简体   繁体   English

React Yarn 构建失败并出现意外行为

[英]React Yarn build fails with unexpected behaviour

While running a yarn build, an infinite loop was induced with below warning:在运行纱线构建时,会引发一个无限循环,并显示以下警告:

(node:7424) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56 parseQuery() will be replaced with getOptions() in the next major version of loader-utils. (node:7424) DeprecationWarning: loaderUtils.parseQuery() 收到一个可能有问题的非字符串值,请参阅https://github.com/webpack/loader-utils/issues/56 parseQuery() 将替换为 getOptions( ) 在 loader-utils 的下一个主要版本中。

Warning, the following targets are using a decimal version:警告,以下目标使用十进制版本:

node: 6.5节点:6.5

We recommend using a string for minor/patch versions to avoid numbers like 6.10 getting parsed as 6.1, which can lead to unexpected behavior.我们建议对次要/补丁版本使用字符串,以避免像 6.10 这样的数字被解析为 6.1,这可能会导致意外行为。

Error screenshot:错误截图:

If you need any file/code, please comment - I'll add them.如果您需要任何文件/代码,请发表评论 - 我会添加它们。 I couldn't understand the issue, so I did not include any code.我无法理解这个问题,所以我没有包含任何代码。

Package.JSON 包.JSON

Without your package.json it's hard to tell where exactly the problem is.没有你的package.json很难说出问题究竟出在哪里。

If your version for your package (or any of the dependencies) isn't using a semantic versioning (for example 6.10.0 instead of just 6.10 which might get trimmed to 6.1) then that is what is causing the problem.如果您的包(或任何依赖项)的版本没有使用语义版本控制(例如 6.10.0 而不是 6.10 可能会被修剪为 6.1),那么这就是导致问题的原因。

When the error mentions minor/patch it is referring to the numbers separated by dots/periods当错误提到小/补丁时,它指的是由点/句点分隔的数字

.. ..

More about this can be found here: https://semver.org/可以在此处找到有关此的更多信息: https : //semver.org/

and here https://docs.npmjs.com/about-semantic-versioning在这里https://docs.npmjs.com/about-semantic-versioning

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM