I am trying to install sqlite3 for use in node.js. However, the installation takes forever and is stuck at the bottom line below.
I have waited at least 15 minutes for anything to happen.
I have also tried installing with --build-from-source
appended, with same same result.
The device I am installing on is a Raspberry Pi, and rebooting it does not solve the issue. Other packages such as socket.io
has been installed successfully previously.
npm install sqlite3
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
/
> [email protected] install /home/pi/ServerGPS/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build
child_process: customFds option is deprecated, use stdio instead.
child_process: customFds option is deprecated, use stdio instead.
make: Entering directory '/home/pi/ServerGPS/node_modules/sqlite3/build'
ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3080900/sqlite3.c
TOUCH Release/obj.target/deps/action_before_build.stamp
CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3080900/sqlite3.o
I originally thought that @travisWebb answer correct, but with time even that build failed with a Unable to copy file...
error. Going back to try and find a solution I came across a post on GitHub looking for a way to make sure I had the build essentials. I came across this answer instead and it worked, relatively quickly at that.
sudo apt-get install libsqlite3-dev
npm install sqlite3 --build-from-source --sqlite=/usr
I suggest you take a look at dblite. Is a wrapper for sqlite.
var dblite = require('dblite'),
db = dblite('file.name');
// Asynchronous, fast, and ...
db.query('SELECT * FROM table', function(err, rows) {
// ... that easy!
});
npm install dblite
The device I am installing on is a Raspberry Pi,
The sqlite3 driver is a native module, and needs to be compiled during installation. This compilation will take much longer on a slower processor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With