ui5 init for new project fails

1.6k views Asked by At
ui5 init --verbose
verb cli:middlewares:base using @ui5/cli version 2.6.4 (from /X/.npm-global/lib/node_modules/@ui5/cli/bin/ui5.js)
verb cli:middlewares:base using node version v14.15.1

⚠️  Process Failed With Error

Error Message:
Could not detect project type: Could not find 'webapp' or 'src' / 'test' folders.
Applications should only have a 'webapp' folder.
Libraries should only have a 'src' and (optional) 'test' folder.

Stack Trace:
Error: Could not detect project type: Could not find 'webapp' or 'src' / 'test' folders.
Applications should only have a 'webapp' folder.
Libraries should only have a 'src' and (optional) 'test' folder.
    at getProjectType (/X/.npm-global/lib/node_modules/@ui5/cli/lib/init/init.js:54:9)
    at Object.init (/X/.npm-global/lib/node_modules/@ui5/cli/lib/init/init.js:92:23)
    at async Object.initCommand.handler (/X/.npm-global/lib/node_modules/@ui5/cli/lib/cli/commands/init.js:22:24)

All I had to do is to first mkdir webapp and proceeding further succeeds. Am I doing something wrong or is the documentation/tool incorrect?

2

There are 2 answers

0
A.vH On BEST ANSWER

There might be a misunderstanding.

ui5 init from the tooling will only create the ui5.yaml required to use ui5 serve later to preview your (existing) app, it will not generate an app.

It would be good if you begin your UI5 app with one of the UI5 Templates and adapt it to your needs.

1
user22440057 On

Check these two

project folder ->open cmd

  1. mkdir webapp
  2. npm init --yes
  3. ui5 init