2

Sqlite3 failed to install in nodejs

tried build from source as well , still not luck

sqlite3@4.1.0 install .../node_modules/sqlite3 node-pre-gyp install --fallback-to-build

/usr/bin/env: node: No such file or directory
npm WARN auto_home@1.0.0 No repository field.

npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! sqlite3@4.1.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the sqlite3@4.1.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Subburaj
  • 5,114
  • 10
  • 44
  • 87
Praveen V
  • 37
  • 1
  • 7

2 Answers2

3

Try running the command after cleaning the npm cache

npm cache clean

If cleaning cache didn't work , upgrade your npm

 npm install -g npm

If there is any permission issue on upgrading add sudo

 sudo  npm install -g npm

reinstall node-gyp

npm install  -g node-gyp

finally, install sqlite3

npm install --save sqlite3
ArUn
  • 1,317
  • 2
  • 23
  • 39
2

install sqlite3@4.1.1 instead.

I discovered this while following the issue https://github.com/mapbox/node-sqlite3/issues/1246#issuecomment-561942175