cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Getting Error While deploying data model to SQLITE

saurabh009
Participant
0 Likes
5,661

In this Tutorial:

https://developers.sap.com/tutorials/cp-apm-nodejs-create-service.html

Step 7.2 : Deploy the data model to an SQLite database:

cds deploy --to sqlite:db/my-bookshop.db

How to do that ?

I am getting Errors..error-1.jpgerror-2.jpg

Accepted Solutions (1)

Accepted Solutions (1)

saurabh009
Participant
0 Likes

RESOLVED now on my own.

What i did ? Delete and re-run all steps.

Where was error: File directory and 1 intermediate step was not performed properly.

Thanks to all for your kind support !

resolved-now.jpg

Answers (2)

Answers (2)

maxstreifeneder
Product and Topic Expert
Product and Topic Expert

Both commands need to be executed within the created CAP project. Doesn't seem you are executing them in the CAP project directory.

npm install -D sqlite3
cds deploy --to sqlite:db/my-bookshop.db
saurabh009
Participant
0 Likes

Also getting this erro now inside VSC

new-error.jpg

maxstreifeneder
Product and Topic Expert
Product and Topic Expert
0 Likes

I assume it is because you are running it in PowerShell. Please try to change your default Shell in VSCode to Bash.
otherwise your cds executable is not installed. (npm install -g @sap/cds-dk)

qmacro
Developer Advocate
Developer Advocate

Hi Saurabh, looks like you have some issues on your Windows machine that is preventing the build of the sqlite3 native components. In your case, I would recommend you take a look at the prerequisites for the CAP Node.js CodeJam, where the instructions take you through a nice way of installing the build tools for that OS, using the Chocolatey package manager. Then you can restart or continue with rene.jeglinsky 's tutorial. HTH!

saurabh009
Participant
0 Likes

Still getting same error after following all steps !

chgeo
Product and Topic Expert
Product and Topic Expert

Hi,

this is most certainly caused by the Node.js version 13 that you use. I guess for Node.js 13 there is no SQLite binary available (yet).

In general we recommend only to use long-term support (LTS) versions of Node.js. Version 12 is the latest LTS version, so my advice is to use this one (see LTS release timeline). It's also this version that is advertised on Node.js's download page as "Recommended for most users".

Regards,

Christian

qmacro
Developer Advocate
Developer Advocate
0 Likes

Saurabh, can you share with us what the output of the following was when you ran the following (from the prerequisites page)?

choco install nodejs-lts
saurabh009
Participant
0 Likes

capture.jpg

This is the output

node.js already installed

Check the version in 2nd screenshotnodejs-version.jpg

saurabh009
Participant
0 Likes

yes i have node.js 13 version only

thanks @Christian Georgi