Registry / web-framework / ui5-middleware-cap

ui5-middleware-cap

JSON →
library3.3.4jsnpmunverified

UI5 CLI middleware that embeds the CDS server middleware from SAP Cloud Application Programming Model (CAP) into the UI5 development server. Version 3.3.4 requires @ui5/cli >=3 and @sap/cds >=6.8.1. It improves local development by integrating CAP services (including mock data and in-memory database) directly into the UI5 dev server lifecycle. Community-maintained, with active monitoring and contributions.

npm install ui5-middleware-cap
INSTALL
IMPORT
SIG · UI5-MIDDLEWARE-CAP
U
ui5-middleware-cap
web-frameworkjavascriptv3.3.4
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ui5-middleware-cap
// No JavaScript import; configured via ui5.yaml server: customMiddleware: - name: ui5-middleware-cap afterMiddleware: compression mountPath: '/cap'
import ui5MiddlewareCap from 'ui5-middleware-cap'
This is a UI5 CLI middleware, not a JavaScript module. It is configured declaratively in ui5.yaml.
cds
const cds = require('@sap/cds')
import { cds } from '@sap/cds'
@sap/cds is CommonJS-only; use require() in Node.js. ESM import may fail.
express
import express from 'express'
const express = require('express')
Modern versions of express support ESM import in Node >=14 via 'import'.

Shows minimal setup: install deps, configure ui5.yaml, verify CDS version, start UI5 server.

// Step 1: Install dependencies npm add ui5-middleware-cap @sap/cds -D // Step 2: Create ui5.yaml in project root with: // specVersion: '3.0' // metadata: // name: my-app // server: // customMiddleware: // - name: ui5-middleware-cap // afterMiddleware: compression // mountPath: '/cap' // Step 3: Ensure @sap/cds version >=6.8.1 in package.json // Step 4: Run UI5 dev server // ui5 serve --port 8080 --open /cap
ui5 --version
Debug
Known issues
breakingMajor version 3 requires @ui5/cli >=3 (specVersion 3.0). Older UI5 CLI versions are not compatible.
fix
Upgrade @ui5/cli to latest major version 3+ and ensure ui5.yaml uses specVersion: '3.0'.
affects: >=3.0
deprecatedThe 'in-memory' option has been renamed to 'in-memory?' with optional question mark syntax. Old usage may break.
fix
Use 'in-memory?' instead of 'in-memory' in ui5.yaml options.
affects: >=3.0
gotchaCDS server is only attached if '@sap/cds' is listed as a dependency or devDependency, not just transitive.
fix
Add '@sap/cds' to your package.json dependencies or devDependencies.
affects: >=3.0
Errors
Common errors & fixes
Error: Cannot find module '@sap/cds'
@sap/cds not installed or version too low
fix
Run `npm install @sap/cds@>=6.8.1 -D` and ensure it's in package.json
Invalid configuration: specVersion must be '3.0'
ui5.yaml uses old specVersion incompatible with middleware
fix
Update ui5.yaml specVersion: '3.0'
TypeError: cds.server is not a function
Incompatible @sap/cds version (<6.8.1)
fix
Upgrade @sap/cds to >=6.8.1
Upgrade
Version history
3.3.4latest on npm
Audit
Dependencies
@sap/cdsrequiredRequired to run the CDS server middleware
@ui5/clirequiredRequired to support specVersion '3.0' and middleware configuration
expressrequiredUnderlying HTTP framework for the middleware
Agent activity
42 hits · last 30 days
node
34
OpenAI (training)
1
Resources
ui5-middleware-cap — npm install ui5-middleware-cap · libregistry