node-sqlite3 icon indicating copy to clipboard operation
node-sqlite3 copied to clipboard

pnpm install sqlite3 fail Error Could not find any Visual Studio installation to use

Open seepine opened this issue 11 months ago • 3 comments

Issue Summary

$ pnpm i
Lockfile is up to date, resolution step is skipped
Packages: +74 -7
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
Progress: resolved 74, reused 74, downloaded 0, added 55, done
node_modules/.pnpm/[email protected]/node_modules/sqlite3: Running install script, failed in 25.3s
.../[email protected]/node_modules/sqlite3 install$ prebuild-install -r napi || node-gyp rebuild  
│ prebuild-install warn install socket hang up
│ gyp info it worked if it ends with ok
│ gyp info using [email protected]
│ gyp info using [email protected] | win32 | x64
│ gyp info find Python using Python version 3.12.8 found at "C:\Users\admin\AppData\Local\Programs\Python\Python31…  
│ gyp http GET https://nodejs.org/download/release/v20.17.0/node-v20.17.0-headers.tar.gz
│ gyp http 200 https://nodejs.org/download/release/v20.17.0/node-v20.17.0-headers.tar.gz
│ gyp http GET https://nodejs.org/download/release/v20.17.0/SHASUMS256.txt
│ gyp http GET https://nodejs.org/download/release/v20.17.0/win-x64/node.lib
│ gyp http GET https://nodejs.org/download/release/v20.17.0/win-arm64/node.lib
│ gyp http GET https://nodejs.org/download/release/v20.17.0/win-x86/node.lib
│ gyp http 200 https://nodejs.org/download/release/v20.17.0/win-x86/node.lib
│ gyp http 200 https://nodejs.org/download/release/v20.17.0/win-x64/node.lib
│ gyp http 200 https://nodejs.org/download/release/v20.17.0/win-arm64/node.lib
│ gyp http 200 https://nodejs.org/download/release/v20.17.0/SHASUMS256.txt
│ gyp ERR! find VS 
│ gyp ERR! find VS msvs_version not set from command line or npm config
│ gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
│ gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel s…  
│ gyp ERR! find VS looking for Visual Studio 2015
│ gyp ERR! find VS - not found
│ gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
│ gyp ERR! find VS 
│ gyp ERR! find VS **************************************************************
│ gyp ERR! find VS You need to install the latest version of Visual Studio
│ gyp ERR! find VS including the "Desktop development with C++" workload.
│ gyp ERR! find VS For more information consult the documentation at:
│ gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
│ gyp ERR! find VS **************************************************************
│ gyp ERR! find VS 
│ gyp ERR! configure error 
│ gyp ERR! stack Error: Could not find any Visual Studio installation to use
│ gyp ERR! stack     at VisualStudioFinder.fail (D:\Workspace\open-sign\open-sign\node_modules\.pnpm\[email protected].…  
│ gyp ERR! stack     at D:\Workspace\open-sign\open-sign\node_modules\.pnpm\[email protected]\node_modules\node-gyp\l…  
│ gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (D:\Workspace\open-sign\open-sign\node_modules\.pn…  
│ gyp ERR! stack     at D:\Workspace\open-sign\open-sign\node_modules\.pnpm\[email protected]\node_modules\node-gyp\l…  
│ gyp ERR! stack     at D:\Workspace\open-sign\open-sign\node_modules\.pnpm\[email protected]\node_modules\node-gyp\l…  
│ gyp ERR! stack     at D:\Workspace\open-sign\open-sign\node_modules\.pnpm\[email protected]\node_modules\node-gyp\l…  
│ gyp ERR! stack     at D:\Workspace\open-sign\open-sign\node_modules\.pnpm\[email protected]\node_modules\node-gyp\l…  
│ gyp ERR! stack     at ChildProcess.exithandler (node:child_process:430:5)
│ gyp ERR! stack     at ChildProcess.emit (node:events:519:28)
│ gyp ERR! stack     at maybeClose (node:internal/child_process:1105:16)
│ gyp ERR! System Windows_NT 10.0.19045
│ gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\Workspace\\open-sign\\open-sign\\node_modules\\.pnpm…  
│ gyp ERR! cwd D:\Workspace\open-sign\open-sign\node_modules\.pnpm\[email protected]\node_modules\sqlite3
│ gyp ERR! node -v v20.17.0
│ gyp ERR! node-gyp -v v8.4.1
│ gyp ERR! not ok 
└─ Failed in 25.3s at D:\Workspace\open-sign\open-sign\node_modules\.pnpm\[email protected]\node_modules\sqlite3
 ELIFECYCLE  Command failed with exit code 1.

Steps to Reproduce

pnpm i [email protected]

Version

"sqlite3": "~5.1.7"

Node.js Version

20.17.0

How did you install the library?

windows10 of pnpm 9.7.0

seepine avatar Dec 20 '24 02:12 seepine

Must install

choco install python visualstudio2022-workload-vctools -y

But strangely, better-sqlite3 is not required.

seepine avatar Dec 20 '24 08:12 seepine

解决了吗?

iwideal avatar Jan 02 '25 14:01 iwideal

解决了吗?

就是前一个回复

choco install python visualstudio2022-workload-vctools -y

seepine avatar Jan 02 '25 14:01 seepine