为啥我使用 frontend-maven-plugin 构建 vue 有一个空错误
Posted
技术标签:
【中文标题】为啥我使用 frontend-maven-plugin 构建 vue 有一个空错误【英文标题】:Why I use frontend-maven-plugin build vue have an empty error为什么我使用 frontend-maven-plugin 构建 vue 有一个空错误 【发布时间】:2021-10-08 14:26:39 【问题描述】:我使用frontend-maven-plugin 来构建我的spring boot 程序,但是我有一个错误。 错误信息:
[INFO] --- frontend-maven-plugin:1.6:install-node-and-npm (install node and npm) @ monitor-admin ---
[INFO] Node v10.16.0 is already installed.
[INFO] NPM 6.9.0 is already installed.
[INFO]
[INFO] --- frontend-maven-plugin:1.6:npm (npm install) @ monitor-admin ---
[INFO] Running 'npm install' in /Users/xxx/Program/xxx/monitor-ui
[WARNING] npm WARN eslint-loader@2.2.1 requires a peer of eslint@>=1.6.0 <7.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN sass-loader@10.1.0 requires a peer of node-sass@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN sass-loader@10.1.0 requires a peer of fibers@>= 3.1.0 but none is installed. You must install peer dependencies yourself.
[ERROR]
[INFO] up to date in 4.55s
[INFO]
[INFO] --- frontend-maven-plugin:1.6:npm (npm run build) @ monitor-admin ---
[INFO] Running 'npm run build:qa' in /Users/xxx/Program/xxx/monitor-ui
[INFO]
[INFO] > monitor@1.0.0 build:qa /Users/xxx/Program/xxx/monitor-ui
[INFO] > vue-cli-service build --mode qa
[INFO]
[INFO]
[ERROR] - Building for qa...
[INFO] WARNING Compiled with 2 warnings5:30:05 PM
[INFO]
[INFO] warning
[INFO]
我的 pom:
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>$frontend-maven-plugin.version</version>
<configuration>
<workingDirectory>$vue.project.root</workingDirectory>
<downloadRoot>http://npm.taobao.org/mirrors/node/</downloadRoot>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v10.16.0</nodeVersion>
<npmVersion>6.9.0</npmVersion>
</configuration>
</execution>
<!-- Install all project dependencies -->
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<!-- optional: default phase is "generate-resources" -->
<phase>generate-resources</phase>
<!-- Optional configuration which provides for running any npm command -->
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<!-- Build and minify static files -->
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build:$activatedProperties</arguments>
</configuration>
</execution>
</executions>
</plugin>
最终构建成功。程序也可以运行了。不知道为什么会出现这个错误。所有日志流看起来都正常。错误没有详细信息,只有一个[错误]。感谢您的帮助
【问题讨论】:
我怀疑这些实际上是错误的。这可能只是maven正在产生的一个进程,它正在写入stderr。 Maven 将其解释为发生的错误,但实际上并非如此。 有什么办法不输出这个错误日志 【参考方案1】:升级frontend-maven-plugin
从 1.6
到 1.10.0
为我工作
<dependency>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.10.0</version>
</dependency>
【讨论】:
以上是关于为啥我使用 frontend-maven-plugin 构建 vue 有一个空错误的主要内容,如果未能解决你的问题,请参考以下文章