Skip to content

Windows build fails #4149

Closed
Closed

Description

@kiliansinger

The windows build fails in develop tag and also in v.0.17.0.
Build instructions of build workflow are used.
Steps to reproduce:
open admin powershell:

# Download and install Chocolatey:
powershell -c "irm https://community.chocolatey.org/install.ps1|iex"
# Download and install Node.js:
choco install nodejs --version="16.20.0"
# Verify the Node.js version:
node -v # Should print "v16.20.0".
# Verify npm version:
npm -v # Should print "8.19.4".
#otherwise do
npm install [email protected] -g
corepack enable yarn

open vs-development powershell (did not work on 2019,2022,2026):

git clone https://github.com/marktext/marktext.git
npm install --global node-gyp@latest
npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}
  
node-gyp install
yarn install --check-files --frozen-lockfile

error message happens with gyp (yarn run rebuild) of ced

yarn run v1.22.22
$ electron-rebuild -f
\ Building module: ced, Completed: 0Traceback (most recent call last):
  File "C:\Users\k\git\marktext2\node_modules\node-gyp\gyp\gyp_main.py", line 42, in <module>
    import gyp  # noqa: E402
    ^^^^^^^^^^
  File "C:\Users\k\git\marktext2\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 9, in <module>
    import gyp.input
  File "C:\Users\k\git\marktext2\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 19, in <module>
    from distutils.version import StrictVersion
ModuleNotFoundError: No module named 'distutils'
× Rebuild Failed

An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild 'C:\Users\k\git\marktext2\node_modules\ced'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

Error: `gyp` failed with exit code: 1



Error: node-gyp failed to rebuild 'C:\Users\k\git\marktext2\node_modules\ced'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

Error: `gyp` failed with exit code: 1


    at NodeGyp.rebuildModule (C:\Users\k\git\marktext2\node_modules\electron-rebuild\lib\src\module-type\node-gyp.js:117:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ModuleRebuilder.rebuildNodeGypModule (C:\Users\k\git\marktext2\node_modules\electron-rebuild\lib\src\module-rebuilder.js:94:9)
    at async ModuleRebuilder.rebuild (C:\Users\k\git\marktext2\node_modules\electron-rebuild\lib\src\module-rebuilder.js:124:14)
    at async Rebuilder.rebuildModuleAt (C:\Users\k\git\marktext2\node_modules\electron-rebuild\lib\src\rebuild.js:145:13)
    at async Rebuilder.rebuild (C:\Users\k\git\marktext2\node_modules\electron-rebuild\lib\src\rebuild.js:108:17)
    at async C:\Users\k\git\marktext2\node_modules\electron-rebuild\lib\src\cli.js:154:9
error Command failed with exit code 4294967295.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 4294967295.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Activity

  1. kiliansinger commented on Mar 19, 2026

    @kiliansinger
    Author

    python -m pip install setuptools
    fixes it.
    Proposing update of build instructions

  2. kiliansinger commented on Mar 19, 2026

    @kiliansinger
    Author

    I just did a PR (#4150) to fix this and also fix pasting html with images to properly save images.

  3. added
    🐛 bug
    🐞 pri/critical
    🐹 platform/windows
    on May 13, 2026
  4. Jocs commented on May 18, 2026

    @Jocs
    Member

    The build steps in this report use Node.js 16 and Yarn, both of which are no longer supported by MarkText. The project now requires Node.js >=20.19.0 and uses pnpm as the package manager ([email protected]).

    The distutils error you encountered is a known Python 3.12+ issue where distutils was removed from the standard library. This is moot with the current toolchain since the rebuild step now uses pnpm and the native-module build has been updated accordingly (#4211, #4230).

    Please follow the updated build instructions in the README using pnpm and Node.js 20+.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐹 platform/windows🐛 bug🐞 pri/critical

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions