jquery - 无法执行目标 com.github.eirslett:frontend-maven-plugin:1.7.5:npm (angularcli build dev) 无法运行任务:'npm run build' 失败
问题描述
我有一个使用 java 和 angular 作为前端的 Web 应用程序
几天前,我从 ng5 迁移到 ng7 并开始使用 npm 而不是 yarn 包管理器。在迁移之前一切都很好,但是之后当我运行时,spring-boot:run goal
我得到了下面的错误
Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.7.5:npm (angularcli build dev) on project ... : Failed to run task: 'npm run build' failed
在这个错误之前,我得到一个关于角度的错误,上面写着
no such file or directory, open '/Users/nariman/Documents/IdeaProject/yadaki/node_modules/jquery/dist/jquery.min.js'
我在我的 package.json 中添加了 jquery 依赖项,但是当我搜索 node_module 包时,有时我无法理解某些内容我有 JQuery 文件夹(带有 Capital Q),其中没有 dist 文件夹(因此应用程序构建失败),有时有一个 jquery 文件夹(带有普通 q),它有一个 dist 文件夹并且应用程序完全构建
我使用前端 Maven 插件
pom.xml
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.7.5</version>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>${node.version}</nodeVersion>
<npmVersion>${npm.version}</npmVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
</execution>
<execution>
<id>angularcli build dev</id>
<goals>
<goal>npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
</executions>
</plugin>
包.json
"jquery": "3.2.1",
angular-version : 7.2.4
node-version : 10.15.3
npm-version : 6.9.0
解决方案
推荐阅读
- c++ - 如何定义模板类模板友元函数,其参数之一是模板类主体之外的依赖名称?
- .net-core - 添加 NuGet 源时,Gitlab 管道遇到错误
- bash - 自动响应 npm/npx 命令行安装中的提示
- python - tkinter 居中两个或多个小部件
- javascript - 向下滚动网站后显示 div
- php - 如何在 bash / php 脚本中执行命令?
- angular - How to create a mat-tree from firebase data in angular
- python - 如何在 Windows 10 中使用 python3.9 检查文件是否在我的 python 脚本之外的另一个进程中主动打开?
- php - 强制显示购物车
- vmware-workstation - 在 CentOS 8 上安装 GlusterFS 不起作用