Windows环境下安装Gekko时sqlite3@3.1.13安装失败求助
Hey there, I’ve dealt with this exact issue a few times when setting up Gekko on Windows. Let’s break down what’s happening first: the error means there’s no precompiled binary for sqlite3@3.1.13 that matches your Node.js version (node@6.9.4, node-v48 ABI). npm is trying to compile sqlite3 from source, but it’s missing the necessary tools to pull that off. Here’s how to fix this step by step:
node-pre-gyp ERR! 尝试下载(undefined):https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v48-win32-x64.tar.gz;node-pre-gyp ERR! 未找到适用于sqlite3@3.1.13和node@6.9.4(node-v48 ABI)的预编译二进制文件(将回退到使用node-gyp进行源码编译);C:\Users\SOBER CHECK\Downloads\gekko-develop\gekko-develop\node_modules\sqlite3>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\np...
Step 1: Install Tools Needed for Source Compilation
Node-gyp (the tool that builds native modules like sqlite3) requires specific dependencies on Windows:
- Python 2.7: Node.js 6.x relies on Python 2.7 (not 3.x) for node-gyp. Download it and make sure to check "Add Python to PATH" during installation.
- Visual Studio Build Tools: Install either the standalone Build Tools (VS2017 or earlier works best for Node 6) and select the "Desktop development with C++" workload, or grab Visual Studio Community Edition with the same workload.
- Configure npm to use the correct tools:
npm config set python python2.7 # Replace 2017 with your installed VS version if different npm config set msvs_version 2017
Step 2: Clean Up and Reinstall Dependencies
Corrupted cache or partial installs might be making things worse, so let’s start fresh:
- Navigate to your Gekko folder in Command Prompt:
cd C:\Users\SOBER CHECK\Downloads\gekko-develop\gekko-develop - Delete the existing modules and lock file:
rmdir /s /q node_modules del package-lock.json - Clear npm’s cache:
npm cache clean --force - Reinstall all dependencies:
npm install
Alternative Fix: Upgrade sqlite3 to a More Compatible Version
If source compilation still fails, the old sqlite3@3.1.13 might be too finicky for Node 6. Try installing a newer, better-supported version that has precompiled binaries for your setup:
npm install sqlite3@^4.0.0 --save
内容的提问来源于stack exchange,提问作者user29357

