cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a Business Service with Node.js Using Visual Studio Code

Mumali
Participant
0 Kudos

Hello,

I am a fresher in SAP Cloud Platform. I previously was able to successfully create a business service with Node.js using SAP Business Application Studio. Now, I am trying one of the missions/tutorials of doing the same thing but through Visual Studio Code. I have set the NPM registry for sap packages and installed cds development kit globally. I installed vsix for CDS Language Support for Visual Studio Code and created the project named my-bookshop. However, when I turn to Visual Studio Code and run npm install, I get the following error. Could someone point me in the right direction? I will be very grateful.

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate

It would seem you don't have Nodejs installed or somehow it's not in your path. Nodejs is required for local development. Have you installed it?

Mumali
Participant
0 Kudos

Hi Thomas,

Thank you for the prompt response. I have installed Node.js. I believe I am running the latest version 13.13.0.

Any suggestions as to why this is not working? As I mentioned before, I am able to run the code in SAP Business Application Studio using Node.js but it won't run in Visual Studio Code.

thomas_jung
Developer Advocate
Developer Advocate

Of course when you use the Business Application Studio you are using the Nodejs in a cloud shell (on a server provided by SAP).

For VSCode development you are running with Nodejs locally on your laptop.

One thing I noticed that in VSCode you are running PowerShell and in the other screenshot you are using the CMD prompt. Try using CMD as your shell on VSCode. There might be some difference in the Environment setup (and therefore path) when running in PowerShell. The other option is don't use the shell in VSCode at all. If node and mom work from CMD; just issue the commands there.

Mumali
Participant
0 Kudos

You are absolutely right. I have changed to CMD as my shell in VSCode and it worked. Thank you for leading to the right track.

thomas_jung
Developer Advocate
Developer Advocate

Well you are creating your project in C:\windows\system32. Probably not a good idea. You'd need admin privileges to write into that folder structure.

Answers (0)