question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CAP ex.4 - Error "Cannot find module 'sqlite3'"

See original GitHub issue

Hello, I am trying to finish ex. 4 of SAP Cloud Application Programming Model (CAP).

But whenever I try to click on “Books” at service web page I get an error.

obrazek

The error in Business Application Studio is

GET /catalog/Books [2020-11-21T20:08:46.513Z | ERROR | 1557126]: { Error: Cannot find module ‘sqlite3’ at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at _loadSqlite (/extbin/npm/globals/lib/node_modules/@sap/cds-runtime/lib/sqlite/Service.js:9:15) at Promise (/extbin/npm/globals/lib/node_modules/@sap/cds-runtime/lib/sqlite/Service.js:31:20) at new Promise (<anonymous>) at _new (/extbin/npm/globals/lib/node_modules/@sap/cds-runtime/lib/sqlite/Service.js:30:10) at SQLiteDatabase.acquire (/extbin/npm/globals/lib/node_modules/@sap/cds-runtime/lib/sqlite/Service.js:156:19) at SQLiteDatabase.<anonymous> (/extbin/npm/globals/lib/node_modules/@sap/cds-runtime/lib/sqlite/Service.js:110:29) code: ‘MODULE_NOT_FOUND’ }

I have installed sqlite and deployed db. npm install sqlite3 -D cds deploy --to sqlite:bookshop.db

I created db connection and connected to it without problem.

I think I followed instructions of this and previous exercises and I don’t know what else to do.

Thank you!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
vikjdk7commented, Apr 28, 2021

For me unsetting node path before running CDS deploy worked

run “npm install sqlite3 -D” run “unset NODE_PATH” run “cds deploy --to sqlite”

1reaction
dasastcommented, Nov 27, 2020

Hello @qmacro, you are right, I am working in the SAP Business Application Studio as described in Devtoberfest2020 Week 3 SAP Cloud Application Programming Model (CAP).

I am using my trial account, dev space of type SAP Cloud Business Application. obrazek

I have tried it and I was successful !

The main reason is that you use command npm install which probably installs more packages than in the video SAP Cloud Application Programming Model - Ex. 03 - Associations & adding persistence used command npm install sqlite3 -D. After npm install I was already successful with command cds deploy --to sqlite:bookshop.db

And also the “Books” link already works.

Thanks very much, I am very happy than I can continue with CAP lessons.

Dasa

Read more comments on GitHub >

github_iconTop Results From Across the Web

[ERROR] Cannot find module 'sqlite3' in SAP CAP model in ...
While I was trying to deploy an application onto the in-memory db sqlite, I get the following error: [ERROR] Cannot find module 'sqlite3'....
Read more >
Cannot find module 'sqlite3' even though is installed
I was trying to run the file server.js on my windows PC but I get an error from my cdm as shown below:...
Read more >
SQLite FTS3 and FTS4 Extensions
Overview. FTS3 and FTS4 are SQLite virtual table modules that allows users to perform full-text searches on a set of documents.
Read more >
Typeorm update vs save
We could not achieve core-supported isomorphic types using TypeORm. typeorm . 5. Entity can be found by a given conditions. 最正常的更新,更新一个已存在 ...
Read more >
NPM Sqlite3 install / build error | by Karthik Ponnam - Medium
This fix also works if you are installing node-gyp module. ... in order to build it from source code if you are a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found