cancel
Showing results for 
Search instead for 
Did you mean: 

Tutorial steps 10 of "Add the SAP Launchpad Service" giving error

Suresh_Desu
Explorer
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Suresh_Desu
Explorer

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

Answers (6)

Answers (6)

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.

Nidhi
Product and Topic Expert
Product and Topic Expert

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

Suresh_Desu
Explorer
0 Kudos

Hi Nidhi,

Did check the mta.yaml file and it looks fine.

for reference, attaching yaml and debug log files. Could you please compare with yours if any is missing.

Thank you,

Suresh

jlongie
Advisor
Advisor
0 Kudos

The yaml file uploaded is not indented correctly. Not sure if this is causing the issue but I've uploaded the same file formatted.

2011629-mtayaml.txt

Please let me know if that works!

0 Kudos

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

jlongie
Advisor
Advisor

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

jlongie
Advisor
Advisor
0 Kudos

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

Suresh_Desu
Explorer
0 Kudos

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

jlongie
Advisor
Advisor

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.

jlongie
Advisor
Advisor
0 Kudos

Create a Windows 10 VM and here are the settings, everything worked fine;

jlongie
Advisor
Advisor
0 Kudos

Please find attached more images.

As regards your issue, I would suggest deleting your global installed modules and try again! Are you on a corporate network? Is anything preventing read access to certain directories?

Suresh_Desu
Explorer
0 Kudos

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.

jlongie
Advisor
Advisor
0 Kudos

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.

jlongie
Advisor
Advisor
0 Kudos

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

Suresh_Desu
Explorer
0 Kudos

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
jlongie
Advisor
Advisor
0 Kudos

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

Suresh_Desu
Explorer
0 Kudos

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