SAP-archive/sap-devtoberfest-2020

SQlite3 file to get installed

David-yanez2 opened this issue · 1 comments

Dear colleagues,

When I try to connecto to the DB using cds connect, it shows an error that sqlite3 is not installed, when I try to install using npm install sqlite3 -D, it shows the following message:

user: bookshop $ npm install
npm WARN deprecated request@2.88.2: request has been deprecated, see request/request#3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN lifecycle The node binary used for scripts is /extbin/bin/node but npm is using /opt/nodejs/node-v10.23.0-linux-x64/bin/node itself. Use the --scripts-prepend-node-path option to include the path for the node binary npm was executed with.

_> sqlite3@5.0.1 install /home/user/projects/bookshop/node_modules/sqlite3

node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-linux-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for sqlite3@5.0.1 and node@10.23.0 (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
make: Entering directory '/home/user/projects/bookshop/node_modules/sqlite3/build'
CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
make: cc: Command not found
make: *** [../node-addon-api/nothing.target.mk:99: Release/obj.target/nothing/../node-addon-api/nothing.o] Error 127
make: Leaving directory '/home/user/projects/bookshop/node_modules/sqlite3/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/opt/nodejs/node-v10.23.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:191:23)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 5.4.0-4-cloud-amd64
gyp ERR! command "/opt/nodejs/node-v10.23.0-linux-x64/bin/node" "/opt/nodejs/node-v10.23.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/user/projects/bookshop/node_modules/sqlite3/lib/binding/napi-v6-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/home/user/projects/bookshop/node_modules/sqlite3/lib/binding/napi-v6-linux-x64" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=6" "--node_napi_label=napi-v6"
gyp ERR! cwd /home/user/projects/bookshop/node_modules/sqlite3
gyp ERR! node -v v10.23.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/opt/nodejs/node-v10.23.0-linux-x64/bin/node /opt/nodejs/node-v10.23.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/user/projects/bookshop/node_modules/sqlite3/lib/binding/napi-v6-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/user/projects/bookshop/node_modules/sqlite3/lib/binding/napi-v6-linux-x64 --napi_version=7 --node_abi_napi=napi --napi_build_version=6 --node_napi_label=napi-v6' (1)
node-pre-gyp ERR! stack at ChildProcess. (/home/user/projects/bookshop/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:198:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:982:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Linux 5.4.0-4-cloud-amd64
node-pre-gyp ERR! command "/opt/nodejs/node-v10.23.0-linux-x64/bin/node" "/home/user/projects/bookshop/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/user/projects/bookshop/node_modules/sqlite3
node-pre-gyp ERR! node -v v10.23.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute '/opt/nodejs/node-v10.23.0-linux-x64/bin/node /opt/nodejs/node-v10.23.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/user/projects/bookshop/node_modules/sqlite3/lib/binding/napi-v6-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/user/projects/bookshop/node_modules/sqlite3/lib/binding/napi-v6-linux-x64 --napi_version=7 --node_abi_napi=napi --napi_build_version=6 --node_napi_label=napi-v6' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sqlite3@5.0.1 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3@5.0.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:_

It seems there is an error to install sqlite3 with the actual version of npm, Any idea how to solve it?.

Best regards.
David.

This is an issue in SQLite3 itself specific to the 5.0.1 version. It looks like the prebuilt binaries were left out: TryGhost/node-sqlite3#1424

If you fix the version to 5.0.0 temporary in the package.json then the install will work. This is a temporary workaround until SQLite project fixes the issue.