Search code examples
ui5-tooling

ui5 init for new project fails


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?


Solution

  • 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.