简体   繁体   中英

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 system32@1.0.0 No description
2779 warn system32@1.0.0 No repository field.
2780 verbose stack Error: sqlite3@4.1.0 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 sqlite3@4.1.0
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 sqlite3@4.1.0 install: `node-pre-gyp install --fallback-to-build`
2789 error Exit status 1
2790 error Failed at the sqlite3@4.1.0 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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM