DudeWhoWantsToLearn
DudeWhoWantsToLearn

Reputation: 771

Error with node-pre-gyp when installing sqlite3

At work we have a Website (WIP), that gets some data of an SQLite Database. As the Website uses Javascript as Backend, we tried to install sqlite3 on the Server where we host the site inofficially for demonstration.

It uses Windows 7 (32 Bit), with 2 GB RAM. Node and NPM, are installed, the only trouble occurs when we try "npm install sqlite3". That part runs without errors, but when "node-pre-gyp install --fallback-to-build" gets executed, it results in this error:

2778 warn [email protected] No description
2779 warn [email protected] No repository field.
2780 verbose stack Error: [email protected] install: `node-pre-gyp install --fallback-to-build`
2780 verbose stack Exit status 1
2780 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
2780 verbose stack     at EventEmitter.emit (events.js:198:13)
2780 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
2780 verbose stack     at ChildProcess.emit (events.js:198:13)
2780 verbose stack     at maybeClose (internal/child_process.js:982:16)
2780 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
2781 verbose pkgid [email protected]
2782 verbose cwd C:\Windows\system32
2783 verbose Windows_NT 6.1.7601
2784 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "sqlite3"
2785 verbose node v10.16.3
2786 verbose npm  v6.9.0
2787 error code ELIFECYCLE
2788 error errno 1
2789 error [email protected] install: `node-pre-gyp install --fallback-to-build`
2789 error Exit status 1
2790 error Failed at the [email protected] install script.
2790 error This is probably not a problem with npm. There is likely additional logging output above.
2791 verbose exit [ 1, true ]

I already updated node, npm, globally installed node-gyp, updated windows, installed Python 2.7 but that didn't help. Current Versions are:

Node: v10.16.3
NPM: v6.9.0

Upvotes: 2

Views: 12107

Answers (1)

Medet Tleukabiluly
Medet Tleukabiluly

Reputation: 11930

This is common problem, it happens when you change your node version, while not rebuilding npm package

Make following steps

  1. Install all the required tools and configurations using Microsoft's windows-build-tools using npm install --global --production windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator). reference
  2. npm install -g node-gyp or npm rebuild node-gyp if you have it already
  3. npm install sqlite3

Upvotes: 13

Related Questions