错误1
(node:28340) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'customMiddleware' of undefined
at handleABAP (C:\Code\UI5\Walkthrough\35\node_modules@sap\ux-ui5-tooling\dist\cli\cmd\add-deploy-config.js:113:29)

错误原因:使用的 Fiori tools CLI 版本过低所致。
"@sap/ux-ui5-tooling": "1.0.10"

https://www.npmjs.com/package/@sap/ux-ui5-tooling

解决办法:使用最新的 1.4.7
版本:

错误消息2
Error: Cannot find proxy middleware config in [C:\Code\UI5\Walkthrough\35\ui5.yaml]
at f (C:\app\node-v12.18.3-win-x64\node_modules@sap\generator-fiori\generators\deployment-generator\abap\index.js:2:616172)
at Object.r.handleErrorMessage (C:\app\node-v12.18.3-win-x64\node_modules@sap\generator-fiori\generators\deployment-generator\abap\index.js:2:616358)

错误原因:ui5.yaml 文件内容不全。
至少应该包含 fiori-tools-proxy
区域。

参考一个格式正确的 ui5.yaml
:
specVersion: '1.0'
metadata:
name: 'project1'
type: application
ui5Theme: sap_fiori_3
server:
customMiddleware:
- name: fiori-tools-proxy
afterMiddleware: compression
configuration:
ignoreCertError: false # If set to true, certificate errors will be ignored. E.g. self-signed certificates will be accepted
backend:
- path: /sap/opu/odata
url: http://localhost
ui5:
path:
- /resources
- /test-resources
url: https://ui5.sap.com
version: # The UI5 version, for instance, 1.78.1. Empty means latest version
- name: fiori-tools-appreload
afterMiddleware: compression
configuration:
port: 35729
path: webapp
错误消息3
info builder:custom deploy-to-abap Create Archive
info builder:custom deploy-to-abap Starting Deployment.on project1 � (11/11) Running task deploy-to-abap...
WARN builder:custom deploy-to-abap Connecting without any credentials, deployment may fail if authorization is required
ERR! builder:custom deploy-to-abap Deployment Failed.tion project1 � (11/11) Running task deploy-to-abap...
ERR! builder:custom deploy-to-abap getaddrinfo ENOTFOUND aa
原因是 ui5-deploy.yaml
文件中 deploy-to-abap
这个自定义 task 的 target
, 即远端 ABAP 系统的 url 维护不正确。


如果看到上图所示的提示消息:
The deployment destination requires authentication. Please enter your credentials below
? Username:
说明 ABAP 系统连接成功。
错误消息4
Upload canceled, archive could not be read or appears to be empty

错误消息和这个帖子介绍的一致。
这个错误和 SAP UI5 tools
的版本有关。
使用 generator-easy-ui5
创建的 SAP UI5 项目,SAP UI5 tools
的默认版本号如下图所示:

"devDependencies": {
"@ui5/cli": "^2.11.1",
"@ui5/fs": "^2.0.6",
"@ui5/logger": "^2.0.1",
"@sap/ux-ui5-tooling": "1",
"rimraf": "3.0.2"
},
"ui5": {
"dependencies": [
"@sap/ux-ui5-tooling"
]
}
解决方案:删除 package-lock.json
文件和 node_modules
文件夹,
执行命令行安装最新版本:
npm install @sap/ux-ui5-tooling@latest

成功安装的版本号:1.4.7

将 package.json
文件里的 deploy
脚本命令更改为:
npm run build && fiori deploy --config ui5-deploy.yaml
![]()
重新执行 npm run deploy
即可:

错误消息5
Remote creation in customer namespace not possible in SAP systems
![]()
解决办法是,提前在 ABAP 系统 ER9 手动创建
好 BSP 应用即可:


另一种方法,参考这个链接。
更多Jerry的原创文章,尽在:"汪子熙":

网友评论