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
muslnode 18–226 runs
build_error
glibcnode 18–226 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
Errors
Common errors & fixes
Error: Cannot find module '@sap/cds'
@sap/cds not installed or version too low
fixRun `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
fixUpdate ui5.yaml specVersion: '3.0'
TypeError: cds.server is not a function
Incompatible @sap/cds version (<6.8.1)
fixUpgrade @sap/cds to >=6.8.1
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