Skip to Content
4
Jul 09, 2022 at 05:37 AM

CDS 6 BTP CF deployment - @sap/cds or @sap/cds-dk?

3018 Views Last edit Jul 09, 2022 at 05:53 AM 2 rev

Hey all - with the new CDS 6 release, I am attempting to upgrade my project environment to Node 16 as recommended. I have everything working fine locally but when deploying to cloud foundry I ran into this error when running "npx cds run" to :

npm ERR! could not determine executable to run

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/matthewreddy/.npm/_logs/2022-07-09T05_14_51_704Z-debug-0.log<br>

I have narrowed down the difference to the presence of @sap/cds-dk v6.0.2 (devDependency) and @sap/cds v6.0.2 (regular dependency) by removing all node modules, fixing my local node to the exact release of Node that the CF nodejs buildpack runs (16.14.2) running a "--production" installation locally (as is done during remote deploy).

Previously, in cds 5.x.x and Node 12 this paradigm worked fine. "npx cds ..." would be recognized as a command supplied by @sap/cds. However, with cds 6.x.x it seems to require @sap/cds-dk to recognize the command.

My question - is this an intentional change? And if so, it seems like we would need both @sap/cds and @sap/cds-dk based on the docs: @sap/cds-dk for the CLI commands and @sap/cds for project usage (i.e. "let cds = require('@sap/cds-dk')". My original impression - from back in the CDS 3 days - was that @sap/cds-dk was meant for local development while the leaner, more direct @sap/cds was intended for production (remote) deployment.