【问题标题】:Vaadin 14 application failed to build frontend after update to npm 7.20.6Vaadin 14 应用程序在更新到 npm 7.20.6 后无法构建前端
【发布时间】:2021-08-16 15:43:34
【问题描述】:

npm 更新到 7.20.6 后,我无法再构建我的 Vaadin 应用程序了。

它给出以下错误:

   Insufficient number of arguments or no entry found.

   Alternatively, run 'webpack(-cli) --help' for usage info.

   Hash: 4deef033da9d3a9fa458

   Version: webpack 4.42.0

  Time: 31ms

  Built at: 08/16/2021 5:02:34 PM

  ERROR in Entry module not found:            Error: Can't resolve 'babel-loader'   in '/srv/github/***/yalsee/_work/yalsee/yalsee/frontend'
  
  ERROR in Entry module not found: Error: Can't resolve 'babel-loader' in '/srv/github/***/yalsee/_work/yalsee/yalsee/frontend'

但是我没有在前端文件夹中使用/导入这个 babel-loader。

我尝试使用 Vaadin 14.5.3 和 14.6.8

两者都给了我相同的结果。

【问题讨论】:

  • npm 安装是否有任何问题,或者 webpack 失败是唯一的例外?
  • 只有 webpack 失败。
  • 我可以通过更新到最新来复制它。只要您删除 node_modules,解决方法就有效。另一个似乎可以正常工作的方法是为以前的版本提供 package-lock.json。
  • 测试了版本,从那里构建失败,似乎 7.20.3 中出现了问题。我们现在将损坏的版本标记为黑名单,并继续在票证github.com/vaadin/flow/issues/11584 中进行调查
  • 这个问题应该会被修复并在下一个版本中推出。

标签: npm webpack vaadin vaadin14


【解决方案1】:

由于尚未出现此问题,我们需要调查为什么 NPM 7.20.6 会影响这样的构建。

作为一种解决方法,您应该将配置块添加到 vaadin-plugin:

<configuration>
  <requireHomeNodeExec>true</requireHomeNodeExec>
</configuration>

这会强制使用已知可以工作的框架安装版本。 更多关于 maven 插件目标的文档可以在 here

找到

【讨论】:

  • 我可以确认解决方法有效。Kiitos/谢谢。
  • 另一种修复/解决方法是添加到package.json devDependencies 依赖项"babel-loader": "8.2.2",
猜你喜欢
  • 2018-05-20
  • 1970-01-01
  • 1970-01-01
  • 2020-02-14
  • 1970-01-01
  • 1970-01-01
  • 2018-01-06
  • 2019-12-21
  • 1970-01-01
相关资源
最近更新 更多