on 07-26-2023 11:04 AM
Dear BAS wizards,
I added cds 7 as dependency and cds-dk 7 as devdependency, but when I try to issue cds commands in a brand new BAS CAP workspace, I'm getting this error:
This application uses @sap/cds version >= 7, which is not compatible with the installed @sap/cds-dk version 6. Either update @sap/cds-dk to version 7 or downgrade @sap/cds to version 6 instead.
...
at build (/extbin/globals/pnpm/5/.pnpm/registry.npmjs.org+@sap+cds-dk@6.8.2/node_modules/@sap/cds-dk/bin/build/all.js:75:30)
This affects the built-in features as well
cds -v dumps the following
@sap/cds: 7.0.3
@sap/cds-compiler: 3.9.4
@sap/cds-dk: 6.8.2
@sap/cds-foss: 4.0.2
@sap/cds-mtx: -- missing --
@sap/cds-mtxs: 1.8.4
@sap/eslint-plugin-cds: 2.6.3
@sap/hana-client: 2.17.21
@sap/hdi-deploy: 4.7.1
@sap/xsenv: 3.4.0
MonitoringCockpitBS: 0.0.1
Node.js: v16.19.0
home: /extbin/globals/pnpm/5/.pnpm/registry.npmjs.org+@sap+cds@6.8.4/node_modules/@sap/cds
It seems 6.8.4 is used in BAS as external binary. Can I switch the version like like setting home to 7.0.2, which is also available in the
/extbin/globals/pnpm/5/.pnpm/
folder ?
With the June update CAP also recommends to use Node.js 18 because 16 is out of minatenance in 1 month. How can we use Node.js 18 in brand new BAS dev spaces, to follow SAP recommendadtions?
There are posts to do update by ourself or against to do it...
package-lock.json were deleted node modules wiped and completely renstalled in the projects.
Some references also checked about side-effects of release changes previously.
https://answers.sap.com/questions/13674288/cds-6-btp-cf-deployment.html
But none of them helped.
Workaround which makes cds serve working, but not cds build:
Moving cds-dk from devdependencies to dependencies in package.json helped, combined with npm rebuild command. But not sure we need cds-dk in production...
Also noticed after tegh above workaround that during cds serve the following that multiple cds versions detected:
As recommended in CAP June update I've added the new separate packages as dependency:
"@sap/cds": "^7",
"@sap/cds-common-content": "^1.2.0",
"@sap/cds-fiori": "^1.0.0",
"@sap/cds-hana": "^2.0.0",
"@sap/cds-foss": "^3.1",
Thank You
Attila
Hello,
You can change the globally installed version by executing npm install -g @sap/cds-dk@<required version>
Regarding Node 18, currently there's no way to change the Node version used in BAS.
The team is working on upgrading to Node 18.
BR,
Licam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the update!
Sometimes you need to open a new Terminal after new version installation because the current Terminal doesn't catch it (same can happen on local PC).
Note that CDS 7 does not require Node.js 18, but still runs with Node.js 16.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
79 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.