VS CODE环境安装和hello world
SAP UI5 demo walkthrough tutorial step1 hello word
首先要安装nodejs,然后才能执行下面的操作
nodejs
vscode
- 安装ui5
npm install --global @ui5/cli
报错解决:
idealTree:npm: sill idealTree buildDeps
这个信息说明npm正在构建,如一直停留在这个界面,检查下网络,例如是否连接的是内网等
- 本地创建你的项目的文件夹APP1 HELLO WORD,VSCODE打开进入APP1 HELLO WORD文件夹后,执行init
npm init --yes
- 在APP1 HELLO WORD中创建webapp文件夹
- 在APP1 HELLO WORD中执行,生成ui5.yaml
ui5 init
报错解决:
- FullyQualifiedErrorId : CommandNotFoundException
确认UI5 Tooling是否已经安装成功(ui5 --version) - FullyQualifiedErrorId : UnauthorizedAccess
以管理员身份运行powershell,执行Set-ExecutionPolicy RemoteSigned命令,然后输入A
- 在webapp里创建manifest.json文件
{"sap.app": {"id": "sap.ui.demo.walkthrough"}
}
- 在APP1 HELLO WORD,VSCODE文件夹里执行,会更新ui5.yaml
ui5 use SAPUI5@latest
- 在webapp文件夹下创建index.html文件
<!DOCTYPE html>
<html><head><meta charset="utf-8"><title>SAPUI5 Walkthrogh</title></head><body><dir>Hello Word</dir></body>
</html>
- 启动server,在APP1 HELLO WORD文件夹下执行
ui5 serve
- 在浏览器里值执行:http://localhost:8080/index.html