Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Windows: better-sqlite3 can't be compiled, because distutils is missing #3013

Closed
3 tasks done
martin-braun opened this issue Jan 27, 2024 · 1 comment
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@martin-braun
Copy link

martin-braun commented Jan 27, 2024

Code of conduct

Self-training on how to write a bug report

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Output during yarn install --frozen-lockfile:

> @signalapp/better-sqlite3@8.5.2 download
> node ./deps/download.js

downloading https://build-artifacts.signal.org/desktop/sqlcipher-4.5.5-fts5-fix--3.0.7--0.2.1-ef53ea45ed92b928ecfd33c552d8d405263e86e63dec38e1ec63e1b0193b630b.tar.gz

> @signalapp/better-sqlite3@8.5.2 build-release
> node-gyp rebuild --release

gyp info it worked if it ends with ok
gyp info using node-gyp@9.3.1
gyp info using node@18.15.0 | win32 | x64
gyp info find Python using Python version 3.12.1 found at "...\scoop\apps\python\current\python.exe"
gyp info find VS using VS2022 (17.8.34511.84) found at:
gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
gyp info find VS run with --verbose for detailed information
gyp info spawn ...\scoop\apps\python\current\python.exe
gyp info spawn args [
gyp info spawn args   '...\\scoop\\persist\\nvm\\nodejs\\v18.15.0\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-I',
gyp info spawn args   '...\\node_modules\\@signalapp\\better-sqlite3\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '...\\scoop\\persist\\nvm\\nodejs\\v18.15.0\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '...\\AppData\\Local\\node-gyp\\Cache\\18.15.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=...\\AppData\\Local\\node-gyp\\Cache\\18.15.0',
gyp info spawn args   '-Dnode_gyp_dir=...\\scoop\\persist\\nvm\\nodejs\\v18.15.0\\node_modules\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=...\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\18.15.0\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=...\\node_modules\\@signalapp\\better-sqlite3',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   '...\\node_modules\\@signalapp\\better-sqlite3\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
Traceback (most recent call last):
  File "...\scoop\persist\nvm\nodejs\v18.15.0\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 42, in <module>
    import gyp  # noqa: E402
    ^^^^^^^^^^
  File "...\scoop\persist\nvm\nodejs\v18.15.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 9, in <module>
    import gyp.input
  File "...\scoop\persist\nvm\nodejs\v18.15.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 19, in <module>
    from distutils.version import StrictVersion
ModuleNotFoundError: No module named 'distutils'
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (...\scoop\persist\nvm\nodejs\v18.15.0\node_modules\npm\node_modules\node-gyp\lib\configure.js:325:16)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Windows_NT 10.0.22621
gyp ERR! command "...\\scoop\\apps\\nvm\\current\\nodejs\\nodejs\\node.exe" "...\\scoop\\persist\\nvm\\nodejs\\v18.15.0\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--release"
gyp ERR! cwd ...\node_modules\@signalapp\better-sqlite3
gyp ERR! node -v v18.15.0

Expected Behavior

Should install and compile dependencies.

Steps To Reproduce

Start the VS Dev Prompt, then nvm use 18 && yarn install --frozen-lockfile.

Desktop Version

No response

Anything else?

@martin-braun martin-braun added the bug Something isn't working label Jan 27, 2024
@martin-braun martin-braun changed the title [BUG] better-sqlite3 can't be compiled, because distutils is missing [BUG] Windows: better-sqlite3 can't be compiled, because distutils is missing Jan 27, 2024
@martin-braun
Copy link
Author

Solved by WiseLibs/better-sqlite3#1093

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant