Search code examples
spartacus-storefront

Unable to add Spartacus to Angular Application


Unable to fetch package information for '@spartacus/[email protected]': No matching version found for @spartacus/[email protected].

I tried to run the command:

ng add @spartacus/[email protected]

The above command throwing me below error:

No matching version found for @spartacus/[email protected].


Solution

  • The spartacus libraries are only published on the node package repository up to 4.3. If you want to use a higher version, you need them from the Repository Based Shipment Channel from SAP, or self publish the package

    Steps for the Repository Based Shipment

    1. Create (or have access to) an S-user for RBSC that has the appropriate licenses to download the composable storefront libraries. If you do not have the correct license, you will get an exception when downloading the packages

    2. Log into your S-user account at the SAP repository address: https://ui.repositories.cloud.sap/www/webapp/users/

    3. Click on Add User and create a technical user.

    4. In the root of your Angular application, create an .npmrc file with the following content:

    @spartacus:registry=https://73554900100900004337.npmsrv.base.repositories.cloud.sap/
    //73554900100900004337.npmsrv.base.repositories.cloud.sap/:_auth=<npmcredentialsfromrbsc>
    always-auth=true
    
    1. In the User Management tab of the RBSC websiteInformation published on SAP site, select the technical user and copy the generated NPM Base64 Credentials.
    2. In the .npmrc file, replace with the NPM Base64 Credentials you copied from the RBSC website.

    For more information, you can check the SAP guide