on 01-03-2022 5:59 AM
At the Step 10 - "Add SAP Fiori elements Risks application" in this tutorial
https://developers.sap.com/tutorials/btp-app-launchpad-service.html
Below error coming after executing command - fiori add deploy-config cf
Adding deploy-config to the project.
info Add:Deploy-config Using: @sap/fiori:deploy-config
? Destination name cpapp-app-srv
Error @sap/fiori:deploy-config cf --base ui5.yaml --config ui5-deploy.yaml
Cannot read properties of undefined (reading 'addRoutingModules')
Do you need to install @sap/generator-fiori globally?
npm install -g @sap/generator-fiori
OR
yarn global add @sap/generator-fiori<br>
Did follow the work around suggestion given in other question, but not luck.
Started this step again with result from git branch -cap-mta-deployment
.
Also did not have any hidded '.yo-rc.json' files in the floder as sugged in another question as well.
The help on deploy-config command not showing any subcommand option 'cf' as in excercise
PS C:\....\cpapp\app\risks> fiori add --help
SAP Fiori tools CLI.
COMMAND NAME:
add - Create or update a target configuration
USAGE:
fiori add [SUBCOMMAND] [...OPTIONS]
SUBCOMMANDS:
deploy-config - Generate or update deploy config in ui5-deploy.yaml file.
--package -p Package name of target deploy system
--transport -t Transport number of target deploy system
--client -l Client number of target deploy system
--index -i Generate index.html in the app (y/n)
--overwrite -f Overwrite existing deploy config (y/n)
--config -c App deploy config file name if it is not ui5-deploy.yaml
--base -b App configuration file name if it is not ui5.yaml <br>
Tried below, it is also the same result
PS C:\.....\cpapp\app\risks> npx -p @sap/ux-ui5-tooling fiori add deploy-config cf
Adding deploy-config to the project.
info Add:Deploy-config Using: @sap/fiori:deploy-config
? Destination name cpapp-app-srv
Error @sap/fiori:deploy-config cf --base ui5.yaml --config ui5-deploy.yaml
Cannot read properties of undefined (reading 'addRoutingModules')
Do you need to install @sap/generator-fiori globally?
npm install -g @sap/generator-fiori
OR
yarn global add @sap/generator-fiori<br>
Appreciate your help. Thanks you.
Thanks John,
YAML validator did help to fix the spaces/indents in mta.yaml file and after that able to move on from this step.
Regards,
Suresh Desu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had the same bug, and I checked the mta.yaml, I found the ":" lost after “moudles” in line 5. After I modified the wrong syntax,I run my project successfully.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suresh,
I was facing the exact same error. The issue was because of a typo in mta.yaml file.
Please check your mta.yaml file, this should fix the issue.
Regards,
Nidhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The yaml file uploaded is not indented correctly. Not sure if this is causing the issue but I've uploaded the same file formatted.
Please let me know if that works!
Hi All,
I got same issue. Any hint?
C:\SAPProjects\CloudFoundaryTutorial\cpapp\app\risks>fiori add deploy-config cf
Adding deploy-config to the project.
info Add:Deploy-config Using: @sap/fiori:deploy-config
? Destination name cpapp-app-srv
Error @sap/fiori:deploy-config cf --base ui5.yaml --config ui5-deploy.yaml
Cannot read properties of undefined (reading 'addRoutingModules')
Do you need to install @sap/generator-fiori globally?
npm install -g @sap/generator-fiori
OR
yarn global add @sap/generator-fiori
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Wondering if you can supply your mta.yaml?
Also, can you install a YAML validator into your IDE? Does this produce any errors?
Thanks.
John
Hi,
Can you please run the following command from a terminal
yo
I need to see what generators you have installed?
If there are no generators installed please go to
https://www.npmjs.com/package/@sap/generator-fiori
And follow the instructions to install the necessary generator to complete this task.
Thanks.
John
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John, the yeoman is installed and below is the list of generators installed.
No packages/installers in app folder, please verify below result.
PS C:\Users\desus\OneDrive\Documents\HCP Tutorial\cpapp\cpapp> yo
? 'Allo desusuresh! What would you like to do? (Use arrow keys)
Run a generator
> @sap/fiori
──────────────
Update your generators
Install a generator
Find some help
Get me out of here!
(Move up and down to reveal more choices)
PS C:\Users\desus\OneDrive\Documents\HCP Tutorial\cpapp\cpapp> npm list --global --depth=0
C:\Program Files\nodejs
+-- @sap/cds-dk@4.7.2
+-- @sap/generator-fiori@1.4.5
+-- @sap/ux-ui5-tooling@1.4.4
+-- @ui5/cli@2.14.2
+-- mbt@1.2.7
+-- mta@1.0.3
+-- npm@6.14.15
+-- windows-build-tools@5.2.2
`-- yo@4.3.0
PS C:\Users\desus\OneDrive\Documents\HCP Tutorial\cpapp\cpapp> cd app/risks
PS C:\Users\desus\OneDrive\Documents\HCP Tutorial\cpapp\cpapp\app\risks> fiori add deploy-config cf
Adding deploy-config to the project.
info Add:Deploy-config Using: @sap/fiori:deploy-config
? Destination name cpapp-app-srv
Error @sap/fiori:deploy-config cf --base ui5.yaml --config ui5-deploy.yaml
Cannot read property 'addRoutingModules' of undefined
Do you need to install @sap/generator-fiori globally?
npm install -g @sap/generator-fiori
OR
yarn global add @sap/generator-fiori
PS C:\Users\desus\OneDrive\Documents\HCP Tutorial\cpapp\cpapp\app\risks> npm list
risks@0.0.1 C:\Users\desus\OneDrive\Documents\HCP Tutorial\cpapp\cpapp\app\risks
`-- (empty)
For reference this is the global npm packages list - npm-list.txt.
Thank you for the quick response
-Suresh
K, let me create a windows VM with these specific versions. The same versions work fine on macOS. As mentioned previously, node v17 does not work as expected.
Hi John,
I tried reinstalling the packages and repeated everything couple of times, still the issue exist.
Doing this exercise on personal pc, no network or admin restrictions but the difference the pc on window 11.
Another difference noticed with your last screenshot- could not locate pacakge '@sapux/generator-s4-fiori".
For now moving on to next exercise since I could not find any resolution with this.
Thank you and appreciate your help.
Another solution is to setup an SAP trial account https://account.hana.ondemand.com/ and subscribe to the SAP Business application studio. This will provide dev spaces with all the generators and versions of npm/node required to run your exercises?
Sorry for any inconvenience caused.
Hi,
Thanks for responding with the version details.
Yes, its an issue with v17 of node. I've replicated a simiiar issue on mac, downgrading to the supported version v14 works fine. If you are using VSCode, it should be installing node v14 at this time (depends on the version of election that is used, unknown when that will be upgraded). SAP Business application studio should also be using v14 as well.
I would suggest using a node version manager to allow you easily switch between projects with different version requirements.
John
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Updated node version to 14, still the problem exist. Restarted the exercise by taking package from given git branch check-out.
Please suggest.
PS C:\Users\...\cpapp\app\risks> fiori add deploy-config cf
Adding deploy-config to the project.
info Add:Deploy-config Using: @sap/fiori:deploy-config
? Destination name cpapp-app-srv
Error @sap/fiori:deploy-config cf --base ui5.yaml --config ui5-deploy.yaml
Cannot read property 'addRoutingModules' of undefined
Do you need to install @sap/generator-fiori globally?
npm install -g @sap/generator-fiori
OR
yarn global add @sap/generator-fiori
PS C:\Users\....\cpapp\app\risks> cds -v
@sap/cds: 5.7.3
@sap/cds-compiler: 2.11.2
@sap/cds-dk: 4.7.2
@sap/cds-foss: 3.0.0
@sap/eslint-plugin-cds: 2.3.0
Node.js: v14.18.2
home: C:\Users\..\AppData\Roaming\nvm\v14.18.2\node_modules\@sap\cds-dk\node_modules\@sap\cds
risks: 0.0.1
PS C:\Users\...\cpapp\app\risks> mta -v
MTA version v1.0.3
PS C:\Users\...\cpapp\app\risks> node -v
v14.18.2
PS C:\Users\...\cpapp\app\risks> npm -v
6.14.15
Hi,
Sorry to hear you are having this issue.
Can you please open a terminal window and run the following commands;
cds -v
mta -v
node -v
npm -v
Thanks.
John
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John,
Please find below. Thanks for looking into this.
PS C:\Users\..\cpapp> cds -v
@sap/cds: 5.7.3
@sap/cds-compiler: 2.11.2
@sap/cds-dk: 4.7.2
@sap/cds-foss: 3.0.0
@sap/eslint-plugin-cds: 2.3.0
@sap/xssec: 3.2.11
Node.js: v17.3.0
cpapp: 1.0.0
home: C:\Users\desus\AppData\Roaming\npm\node_modules\@sap\cds-dk\node_modules\@sap\cds
PS C:\Users\....\cpapp> mta -v
MTA version v1.0.3
PS C:\Users\....\cpapp> node -v
v17.3.0
PS C:\...\cpapp> npm -v
8.3.0
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.