Ошибка сборки при использовании Github Action CI/CD

Я использовал CI CD Github Action для своей сборки, и моя сборка не работает для ветки на github. Это ошибка, которая у меня была:

      Error:  Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.11.2:npm (npm run build) on project demo: Failed to run task: 'npm run build' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
Error:  
Error:  To see the full stack trace of the errors, re-run Maven with the -e switch.
Error:  Re-run Maven using the -X switch to enable full debug logging.
Error:  
Error:  For more information about the errors and possible solutions, please read the following articles:
Error:  [Help 1] http://cwiki.apache.org/.../MAVEN/MojoFailureException
Error: Process completed with exit code 1.

Я пытаюсь запустить npm run build на моем локальном компьютере, и он работает полностью нормально.

1 ответ

Перейдите в свой файл pom.xml, и если ваш код похож на этот

                   <plugin>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId> 
                        ...

                        <execution>
                            <id>npm audit fix</id>
                            <goals>
                                <goal>npm</goal>
                            </goals>

                            <configuration>
                            <arguments>install</arguments>
                            </configuration>
                        </execution>

                       ...
             </plugin>

удалять <configuration>...</configuration>часть, и chnage, как это

                   <plugin>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId> 
                        ...

                        <execution>
                            <id>npm audit fix</id>
                            <goals>
                                <goal>npm</goal>
                            </goals>
                        </execution>

                       ...
             </plugin>

во всех ваших <execution>...</execution>. Я надеюсь, что ваш код будет работать нормально.

Другие вопросы по тегам