npm安装sqlite3报错信息如下:
E:\temp\nodejs>npm install sqlite3
-
> sqlite3@3.1.8 install E:\temp\nodejs\node_modules\sqlite3
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.8/electron-v1.2-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.8 and electron@1.2.0 (electron-v1.2 ABI) (falling back to source compile with node-gyp)
E:\temp\nodejs\node_modules\sqlite3>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" clean ) else (node "" clean )
E:\temp\nodejs\node_modules\sqlite3>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure --fallback-to-build --module=E:\temp\nodejs\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=E:\temp\nodejs\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64 ) else (node "" configure --fallback-to-build --module=E:\temp\nodejs\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=E:\temp\nodejs\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64 )
E:\temp\nodejs\node_modules\sqlite3>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" build --fallback-to-build --module=E:\temp\nodejs\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=E:\temp\nodejs\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64 ) else (node "" build --fallback-to-build --module=E:\temp\nodejs\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=E:\temp\nodejs\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64 )
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
MSBUILD : error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。要解决此问题,1) 安装 .NET Framework 2.0 SDK;2) 安装 Microsoft Visual Stu
dio 2005;或 3) 如果将该组件安装到了其他位置,请将其位置添加到系统路径中。 [E:\temp\nodejs\node_modules\sqlite3\build\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=E:\\temp\\nodejs\\node_modules\\sqlite3\\lib\\binding\\electron-v1.2-win32-x64\\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=E:\\temp\\nodejs\\node_modules\\sqlite3\\lib\\binding\\electron-v1.2-win32-x64"
gyp ERR! cwd E:\temp\nodejs\node_modules\sqlite3
gyp ERR! node -v v4.6.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd build --fallback-to-build --module=E:\temp\nodejs\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=E:\temp\nodejs\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (E:\temp\nodejs\node_modules\sqlite3\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:829:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Windows_NT 10.0.14393
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\temp\\nodejs\\node_modules\\sqlite3\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd E:\temp\nodejs\node_modules\sqlite3
node-pre-gyp ERR! node -v v4.6.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.31
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd build --fallback-to-build --module=E:\temp\nodejs\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=E:\temp\nodejs\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64' (1)
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "sqlite3"
npm ERR! node v4.6.0
npm ERR! npm v2.15.9
npm ERR! code ELIFECYCLE
npm ERR! sqlite3@3.1.8 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3@3.1.8 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! This is most likely a problem with the sqlite3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs sqlite3
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls sqlite3
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! E:\temp\nodejs\npm-debug.log
解决方案是:** cnpm install sqlite3**