Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Started in a Nutshell: sqlite3 not found #1269

Closed
XinLanSAP opened this issue Sep 24, 2024 · 2 comments
Closed

Getting Started in a Nutshell: sqlite3 not found #1269

XinLanSAP opened this issue Sep 24, 2024 · 2 comments
Assignees

Comments

@XinLanSAP
Copy link

XinLanSAP commented Sep 24, 2024

Hi,

I encountered an issue (perhaps) and would like to get your review:

I first followed the step-by-step guide on this page: https://cap.cloud.sap/docs/get-started/in-a-nutshell, I installed Node.js, the @sap/cds-dk (using npm i -g @sap/cds-dk), and VSCode. Then I created a new project using cds init, typed cds bookshop, then cds watch.
After I saved the changes in db/schema.cds, the terminal showed like attached log. After I installed sqlite3 via npm, the issue had been resolved.

----------------------------------------------
  db\schema.cds
  ..\..\..\..\Program Files\node-v18.19.0-win-x86\node_modules\@sap\cds-dk\node_modules\@sap\cds\common.cds

[cds] - connect using bindings from: { registry: '~/.cds-services.json' }
[cds] - connect to db > sqlite { database: ':memory:' }
/> deployment to in-memory database. failed


❗️ ERROR on server start: ❗️

 Error: Cannot find module 'sqlite3'
Require stack:
- C:\Program Files\node-v18.19.0-win-x86\node_modules\@sap\cds-dk\node_modules\@sap\cds\libx\_runtime\sqlite\Service.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
    at Module._load (node:internal/modules/cjs/loader:975:27)
    at Module.require (node:internal/modules/cjs/loader:1225:19)
    at require (node:internal/modules/helpers:177:18)
    at _new (C:\Program Files\node-v18.19.0-win-x86\node_modules\@sap\cds-dk\node_modules\@sap\cds\libx\_runtime\sqlite\Service.js:21:27)
    at SQLiteDatabase.acquire (C:\Program Files\node-v18.19.0-win-x86\node_modules\@sap\cds-dk\node_modules\@sap\cds\libx\_runtime\sqlite\Service.js:123:19)  
    at SQLiteDatabase.begin (C:\Program Files\node-v18.19.0-win-x86\node_modules\@sap\cds-dk\node_modules\@sap\cds\libx\_runtime\db\Service.js:43:23)
    at SQLiteDatabase._begin [as dispatch] (C:\Program Files\node-v18.19.0-win-x86\node_modules\@sap\cds-dk\node_modules\@sap\cds\lib\srv\srv-tx.js:199:38)   
    at SQLiteDatabase.run (C:\Program Files\node-v18.19.0-win-x86\node_modules\@sap\cds-dk\node_modules\@sap\cds\lib\srv\srv-api.js:76:17)
    at deploy.schema (C:\Program Files\node-v18.19.0-win-x86\node_modules\@sap\cds-dk\node_modules\@sap\cds\lib\dbs\cds-deploy.js:117:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Program Files\\node-v18.19.0-win-x86\\node_modules\\@sap\\cds-dk\\node_modules\\@sap\\cds\\libx\\_runtime\\sqlite\\Service.js'
  ]
}
----------------------------------
@renejeglinsky
Copy link
Contributor

Hi @XinLanSAP,

I can't reproduce this behavior. Could you check if your dependencies look similar?
image

@renejeglinsky renejeglinsky self-assigned this Sep 26, 2024
@chgeo chgeo changed the title Incomplete description on Chapter <Getting Started in a Nutshell> Getting Started in a Nutshell: sqlite3 not found Oct 31, 2024
@chgeo
Copy link
Member

chgeo commented Nov 4, 2024

Assuming this is resolved. Please ping if still valid.

@chgeo chgeo closed this as not planned Won't fix, can't repro, duplicate, stale Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants