m4heshd / better-sqlite3-multiple-ciphers

better-sqlite3 with multiple-cipher encryption support 🔒
MIT License
137 stars 27 forks source link

Can't install v9.0.0 - VS issue and solution #72

Closed NoxFly closed 10 months ago

NoxFly commented 10 months ago

I was using v8.5.1. I tried to update to 9.0.0. It crashed with below logs. I tried uninstall + reinstall, same. I tried on a blank project, same. I reinstalled 8.5.1, no issue.

Tech :

noxfly@TUF-Noxfly MINGW64 /d/codes/nodejs/project
$ npm i better-sqlite3-multiple-ciphers
npm ERR! code 1
npm ERR! path D:\codes\nodejs\project\node_modules\better-sqlite3-multiple-ciphers
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c prebuild-install || node-gyp rebuild --release
npm ERR! copy_builtin_sqlite3
npm ERR! C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(1016,5): error MSB3191: Unable to create directory "D:\codes\nodejs\project\node_modules\better-sqlite3-multiple-ciphers\build\deps\Release\obj\sqlite3\D:\codes\nodejs\project\node_modules\better-sqlite3- multiple-ciphers\build\Release\obj\global_intermediate\sqlite3". The given path format is not supported. [D:\codes\nodejs\project\node_modules\better-sqlite3-multiple-ciphers\build\deps\sqlite3.vcxproj]
npm ERR! prebuild-install warn install No prebuilt binaries found (target=16.14.0 runtime=node arch=x64 libc= platform=win32)
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.4.0
npm ERR! gyp info using node@16.14.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.8 found at "C:/msys64/mingw64/bin/python3.exe"
npm ERR! gyp info find VS using VS2022 (17.7.34031.279) found at:
npm ERR! gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:/msys64/mingw64/bin/python3.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'D:\\codes\\nodejs\\project\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'msvs',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'D:\\codes\\nodejs\\project\\node_modules\\better-sqlite3-multiple-ciphers\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'D:\\codes\\nodejs\\project\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\noxfly\\AppData\\Local\\node-gyp\\Cache\\16.14.0\\include\\node\\common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=C:\\Users\\noxfly\\AppData\\Local\\node-gyp\\Cache\\16.14.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=D:\\codes\\nodejs\\project\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\noxfly\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\16.14.0\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=D:\\codes\\nodejs\\project\\node_modules\\better-sqlite3-multiple-ciphers',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'D:\\codes\\nodejs\\project\\node_modules\\better-sqlite3-multiple-ciphers\\build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'build/binding.sln',
npm ERR! gyp info spawn args   '/clp:Verbosity=minimal',
npm ERR! gyp info spawn args   '/nologo',
npm ERR! gyp info spawn args   '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onExit (D:\codes\nodejs\project\node_modules\node-gyp\lib\build.js:203:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:520:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19045
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\codes\\nodejs\\project\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--release"
npm ERR! gyp ERR! cwd D:\codes\nodejs\project\node_modules\better-sqlite3-multiple-ciphers
npm ERR! gyp ERR! node -v v16.14.0
npm ERR! gyp ERR! node-gyp -v v9.4.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: C:\Users\noxfly\AppData\Local\npm-cache\_logs\2023-10-26T21_08_07_843Z-debug-0.log
NoxFly commented 10 months ago

Solution was to upgrade Node (I've downloaded the LTS, at this date 20.9.0). I've not tested with Node v18, but Node v16 does not work with the v9.0.0 of this repo.

m4heshd commented 10 months ago

You must've missed this on the release note:

image

You can, however, build v9.0.0 against Node v16 yourself just fine. But not with VS2022. Try using VS2019. As seen here, it's the reason why we use the windows-2019 image for prebuilds.

Either way, it's always better not to use EOLed runtimes.