Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/470.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Webpack-ReactJs的参数数量不足-Spring启动应用程序_Javascript_Reactjs_Spring_Maven_Webpack - Fatal编程技术网

Javascript Webpack-ReactJs的参数数量不足-Spring启动应用程序

Javascript Webpack-ReactJs的参数数量不足-Spring启动应用程序,javascript,reactjs,spring,maven,webpack,Javascript,Reactjs,Spring,Maven,Webpack,我有一个springboot应用程序,它的前端部分是ReactJs 我正在尝试使用配置前端的构建过程 前端maven插件如下: <!-- tag::frontend-maven-plugin[] --> <plugin> <groupId>com.github.eirslett</groupId> <artifactId>frontend-maven

我有一个springboot应用程序,它的前端部分是ReactJs

我正在尝试使用配置前端的构建过程 前端maven插件如下:

<!-- tag::frontend-maven-plugin[] -->
            <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>1.6</version>
                <configuration>
                    <installDirectory>src/main/webapp/invoicing-frontend</installDirectory>
                    <workingDirectory>src/main/webapp/invoicing-frontend</workingDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>install node and npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                        <configuration>
                            <nodeVersion>v12.13.1</nodeVersion>
                            <npmVersion>6.12.1</npmVersion>
                        </configuration>
                    </execution>
                    <execution>
                        <id>npm install</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>install</arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>webpack build</id>
                        <goals>
                            <goal>webpack</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- end::frontend-maven-plugin[] -->
项目目录如下:

myapp.src.main
    - java
    - webapp
        -myapp-frontend
            -node
            -node_modules
            -public
                -index.html
            -src
                -built
                -components (where React components are)
                -css
                -img
                -js
                -index.js
            -package.json
            -webpack.config.js
运行webpack build命令时,将显示以下输出:

参数数量不足或找不到条目。或者,运行 有关用法信息,请使用“webpack(-cli)--帮助”

哈希:版本:webpack 4.41.2时间:33ms构建 时间:2019-12-12 16:34:22

未找到输入模块中的错误:错误:无法解析中的“生成” 'C:\Users\testuser\Projects\myapp\src\main\webapp\myapp frontend'

我很确定这个错误来自一个不正确的webpack.config.js,但我自己似乎无法修复它。
感谢您对解决此错误的任何帮助

当您从命令行执行webpack,从myapp前端的根目录执行它时,会发生什么情况?我认为该命令可能不是从正确的目录执行的。@跟踪我提供的错误实际上是在从命令行执行时发生的。@跟踪我用完整的错误编辑了我的问题您需要执行的命令是没有参数的webpack。Webpack build是指定给maven目标的id。在您的情况下,当前工作目录应该是:myapp frontend
myapp.src.main
    - java
    - webapp
        -myapp-frontend
            -node
            -node_modules
            -public
                -index.html
            -src
                -built
                -components (where React components are)
                -css
                -img
                -js
                -index.js
            -package.json
            -webpack.config.js