cancel
Showing results for 
Search instead for 
Did you mean: 

[CAP][CDS-TS] Powershell -> The term 'ts-node.exe' is not recognized as a name of a cmdlet,..

tobias_steckenborn
Active Participant
1,630

Hi there,

When trying to use cds-ts with PowerShell I received the following error message:

&: C:\Users\<user>\AppData\Roaming\npm\cds-ts.ps1:15:5
Line |
  15 |    & "ts-node$exe"  "$basedir/node_modules/@sap/cds-dk/bin/cds-ts.js"  …
     |      ~~~~~~~~~~~~~
     | The term 'ts-node.exe' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Removing $exe solves the issue for me. Might be something to look into.

Best regards,

Tobias

Accepted Solutions (0)

Answers (2)

Answers (2)

Attila
Active Participant

Hello CAPpers,

after following other suggestions as well to save adjustment efforts of the cds-ts module all the time, I I've tried to set newly installed Powershell 7 as default under settings in Terminal as well, so VSCode opens new Powershell 7 (pwsh) as default terminal.
I stilled faced the issue, as alternate I tried to run it with

npx cds-ts run 

It seems working properly including debugging, so I started to use it in package.json and launch.json in VSCode.

Best regards

Attila

shf
Explorer
0 Kudos
How do I configure package.json to use the "npx cds-ts run" command?
gregorw
Active Contributor
0 Kudos

TypeScript is intened for dev-time. For deployment you compile to normal JavaScript. Check out https://cap.cloud.sap/docs/tools/cds-typer#integrate-into-your-build-process for the details.