I installed knex
to connect to mysql
database from my Nextjs
application.
But Knex
returned me this error:
Knex: run
$ npm install sqlite3 –save
Cannot find module ‘sqlite3’
Require stack:
- C:UsersMyNameDocumentsProgrammingchessgameschessgames-appnode_modulesknexlibdialectssqlite3index.js
- C:UsersMyNameDocumentsProgrammingchessgameschessgames-appnode_modulesknexlibdialectsindex.js
- C:UsersMyNameDocumentsProgrammingchessgameschessgames-appnode_modulesknexlibknex-builderinternalconfig-resolver.js
- C:UsersMyNameDocumentsProgrammingchessgameschessgames-appnode_modulesknexlibknex-builderKnex.js
- C:UsersMyNameDocumentsProgrammingchessgameschessgames-appnode_modulesknexlibindex.js
So I did npm install sqlite3 --save
but it does not work on both Powershell
and git bash
In Powershell
, I get this error:
PS C:UsersMyNameDocumentsProgrammingchessgameschessgames-app> npm install sqlite3
npm WARN deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm ERR! code 1
npm ERR! path C:UsersMyNameDocumentsProgrammingchessgameschessgames-appnode_modulessqlite3
npm ERR! command failed
npm ERR! command powershell -c prebuild-install -r napi || node-gyp rebuild
npm ERR! At line:1 char:26
npm ERR! + prebuild-install -r napi || node-gyp rebuild
npm ERR! + ~~
npm ERR! The token '||' is not a valid statement separator in this version.
npm ERR! + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
npm ERR! + FullyQualifiedErrorId : InvalidEndOfLine
npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersMyNameAppDataLocalnpm-cache_logs2024-05-12T19_45_44_730Z-debug-0.log
PS C:UsersMyNameDocumentsProgrammingchessgameschessgames-app>
in git bash
, I get this error
$ npm install sqlite3 --save
C:UsersMyNameAppDataRoamingnpm/node: line 8:
C:UsersMyNameAppDataRoamingnpm/node_modules/node/bin/node: No such file or directory
It does not really important in which environment the command needs to work, I just want to make it work somehow. How can I fix this issue?