adonisjs / lucid

AdonisJS SQL ORM. Supports PostgreSQL, MySQL, MSSQL, Redshift, SQLite and many more
https://lucid.adonisjs.com/
MIT License
1.08k stars 195 forks source link

Using sqlite-db option in npm init throws error when building a dockerfile #1060

Closed MightyMoud closed 3 weeks ago

MightyMoud commented 3 weeks ago

Package version

better-sqlite: 11.5.0

Describe the bug

Just a using a the simple npm init command and choosing sqlite as a database throws this error on during the docker file build. I used the docker file from the docs

8.729 npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
8.729 npm ERR! gyp ERR! stack at PythonFinder.fail (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:306:11)
8.729 npm ERR! gyp ERR! stack at PythonFinder.findPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:164:17)
8.729 npm ERR! gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
8.729 npm ERR! gyp ERR! stack at async configure (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:23:18)
8.729 npm ERR! gyp ERR! stack at async run (/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js:81:18)
8.729 npm ERR! gyp ERR! System Linux 6.10.12-orbstack-00282-gd1783374c25e
8.729 npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
8.729 npm ERR! gyp ERR! cwd /app/node_modules/better-sqlite3
8.729 npm ERR! gyp ERR! node -v v20.12.2
8.729 npm ERR! gyp ERR! node-gyp -v v10.0.1

So seems like better-sqlite depends on node-gyp and that needs python on the host system which doesn't exist in docker

Happy for provide a reproduction repo, but this is just by running the npm init command and trying to build a docker image.

Reproduction repo

No response

RomainLanz commented 3 weeks ago

Hey @MightyMoud! 👋🏻

The Dockerfile example in our documentation is designed as a starting point. Feel free to tweak it to fit your app's specific needs.

MightyMoud commented 3 weeks ago

Got it.

Thanks @RomainLanz