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

Cannot build on Windows #13603

Closed
matkuki opened this issue Apr 14, 2024 · 17 comments
Closed

Cannot build on Windows #13603

matkuki opened this issue Apr 14, 2024 · 17 comments

Comments

@matkuki
Copy link

matkuki commented Apr 14, 2024

Bug Description:

When using the build instructions for Windows (https://github.com/eclipse-theia/theia/blob/master/doc/Developing.md#building-on-windows), the procedure fails at the step after cloning the repository:

git clone https://github.com/eclipse-theia/theia.git \
    && cd theia \
    && yarn \      <-   HERE IS WHERE THE ERROR OCCURS
    && yarn browser build \
    && yarn browser start

with this error:

...
[4/5] Linking dependencies...
warning " > @theia/[email protected]" has unmet peer dependency "electron@^23.2.4".
warning "workspace-aggregator-be564bbb-db96-49b8-a062-2948397d5c8d > @theia/messages > react-perfect
[email protected]" has unmet peer dependency "react@>=16.3.3".
warning "workspace-aggregator-be564bbb-db96-49b8-a062-2948397d5c8d > @theia/messages > react-perfect
[email protected]" has unmet peer dependency "react-dom@>=16.3.3".
warning "workspace-aggregator-be564bbb-db96-49b8-a062-2948397d5c8d > @theia/preview > markdown-it-an
[email protected]" has unmet peer dependency "markdown-it@^8.4.1".
warning "workspace-aggregator-be564bbb-db96-49b8-a062-2948397d5c8d > @theia/process > [email protected].
0-beta17" has incorrect peer dependency "node-gyp@^8.3.0".
warning "workspace-aggregator-be564bbb-db96-49b8-a062-2948397d5c8d > @theia/scm > react-autosize-tex
[email protected]" has unmet peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
warning "workspace-aggregator-be564bbb-db96-49b8-a062-2948397d5c8d > @theia/scm > react-autosize-tex
[email protected]" has unmet peer dependency "react-dom@^0.14.0 || ^15.0.0 || ^16.0.0".
[5/5] Building fresh packages...
[10/19] ⢀ drivelist
[11/19] ⢀ keytar
[13/19] ⢀ node-pty
[9/19] ⢀ native-keymap
error E:\NodeJS\theia\node_modules\node-pty: Command failed.
Exit code: 1
Command: node scripts/install.js
Arguments:
Directory: E:\NodeJS\theia\node_modules\node-pty
Output:
node:internal/child_process:421
    throw new ErrnoException(err, 'spawn');
    ^

Error: spawn EINVAL
    at ChildProcess.spawn (node:internal/child_process:421:11)
    at spawn (node:child_process:761:9)
    at Object.<anonymous> (E:\NodeJS\theia\node_modules\node-pty\scripts\install.js:11:20)
    at Module._compile (node:internal/modules/cjs/loader:1369:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
    at Module.load (node:internal/modules/cjs/loader:1206:32)
    at Module._load (node:internal/modules/cjs/loader:1022:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49 {
  errno: -4071,
  code: 'EINVAL',
  syscall: 'spawn'

Steps to Reproduce:

  1. Follow the procedure described at: https://github.com/eclipse-theia/theia/blob/master/doc/Developing.md#building-on-windows

Additional Information

  • Operating System: Windows 10 x64
  • Theia Version: Development (cloned from Github)
@msujew
Copy link
Member

msujew commented Apr 14, 2024

Hey @matkuki, which version of Node are you using?

@matkuki
Copy link
Author

matkuki commented Apr 14, 2024

Hey @msujew , thanks for the quick reply.
Here is my Node version:

$ node --version
v20.12.2

@msujew
Copy link
Member

msujew commented Apr 14, 2024

While that version is supposed to be supported, with node-pty being a natively compiled node package, it might be worthwhile to test whether it works with the latest version of node v18. It's our recommended version, can you try that? Otherwise, since the error appears in the install script of node-pty, it might make sense to ask them directly.

@matkuki
Copy link
Author

matkuki commented Apr 14, 2024

Thanks @msujew ,
Changed to 18.17.0, now I get:

...
[5/5] Building fresh packages...
[14/19] ⠁ @vscode/ripgrep
[10/19] ⠁ drivelist
[13/19] ⠁ node-pty
[11/19] ⠁ keytar
error E:\NodeJS\theia\node_modules\@vscode\ripgrep: Command failed.
Exit code: 1
Command: node ./lib/postinstall.js
Arguments:
Directory: E:\NodeJS\theia\node_modules\@vscode\ripgrep
Output:
Finding release for v13.0.0-10
GET https://api.github.com/repos/microsoft/ripgrep-prebuilt/releases/tags/v13.0.0-10
Deleting invalid download cache
Downloading ripgrep failed: Error: Request failed: 401
    at ClientRequest.<anonymous> (E:\NodeJS\theia\node_modules\@vscode\ripgrep\lib\download.js:109:24)
    at Object.onceWrapper (node:events:629:26)
    at ClientRequest.emit (node:events:514:28)
    at HTTPParser.parserOnIncomingClient (node:_http_client:700:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
    at TLSSocket.socketOnData (node:_http_client:541:22)
    at TLSSocket.emit (node:events:514:28)

@msujew
Copy link
Member

msujew commented Apr 14, 2024

@matkuki Are you behind a proxy that blocks the GitHub API? I can curl/access that URL just fine.

@matkuki
Copy link
Author

matkuki commented Apr 14, 2024

@msujew No. Just did a clean git clone again, same error.
Opening the page in a browser shows this:
image

@msujew
Copy link
Member

msujew commented Apr 15, 2024

Sounds like #7837, maybe running yarn cache clean works for you as well?

@matkuki
Copy link
Author

matkuki commented Apr 15, 2024

Thank you for your patience. Tried that, same result.
Here is the full process output:

PS E:\NodeJS\theia> yarn cache clean
yarn cache v1.22.4
success Cleared cache.
Done in 0.09s.
PS E:\NodeJS\theia> yarn
yarn install v1.22.4
$ node-gyp install
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp http GET https://nodejs.org/download/release/v18.17.0/node-v18.17.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v18.17.0/node-v18.17.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v18.17.0/SHASUMS256.txt
gyp http GET https://nodejs.org/download/release/v18.17.0/win-x64/node.lib
gyp http 200 https://nodejs.org/download/release/v18.17.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v18.17.0/win-x64/node.lib
undefined
gyp info ok
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from in
stallation.
info @nx/[email protected]: The platform "win32" is incompatible with this module.
info "@nx/[email protected]" is an optional dependency and failed compatibility check. Excludi
ng it from installation.
info @nx/[email protected]: The CPU architecture "x64" is incompatible with this module.
info @nx/[email protected]: The platform "win32" is incompatible with this module.
info "@nx/[email protected]" is an optional dependency and failed compatibility check. Excluding
 it from installation.
info @nx/[email protected]: The platform "win32" is incompatible with this module.
info "@nx/[email protected]" is an optional dependency and failed compatibility check. Excludin
g it from installation.
info @nx/[email protected]: The platform "win32" is incompatible with this module.
info "@nx/[email protected]" is an optional dependency and failed compatibility check.
Excluding it from installation.
info @nx/[email protected]: The CPU architecture "x64" is incompatible with this module
.
info @nx/[email protected]: The platform "win32" is incompatible with this module.
info "@nx/[email protected]" is an optional dependency and failed compatibility check. Excl
uding it from installation.
info @nx/[email protected]: The CPU architecture "x64" is incompatible with this module.
info @nx/[email protected]: The platform "win32" is incompatible with this module.
info "@nx/[email protected]" is an optional dependency and failed compatibility check. Exc
luding it from installation.
info @nx/[email protected]: The CPU architecture "x64" is incompatible with this module.
info @nx/[email protected]: The platform "win32" is incompatible with this module.
info "@nx/[email protected]" is an optional dependency and failed compatibility check. Exclud
ing it from installation.
info @nx/[email protected]: The platform "win32" is incompatible with this module.
info "@nx/[email protected]" is an optional dependency and failed compatibility check. Exclu
ding it from installation.
info @nx/[email protected]: The CPU architecture "x64" is incompatible with this module.
info "@nx/[email protected]" is an optional dependency and failed compatibility check. Exc
luding it from installation.
warning [email protected]: The engine "vscode" appears to be invalid.
warning [email protected]: The engine "vscode" appears to be invalid.
warning [email protected]: The engine "vscode" appears to be invalid.
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from in
stallation.
info @msgpackr-extract/[email protected]: The platform "win32" is incompatible wit
h this module.
info "@msgpackr-extract/[email protected]" is an optional dependency and failed co
mpatibility check. Excluding it from installation.
info @msgpackr-extract/[email protected]: The CPU architecture "x64" is incompatib
le with this module.
info @msgpackr-extract/[email protected]: The platform "win32" is incompatible with
this module.
info "@msgpackr-extract/[email protected]" is an optional dependency and failed comp
atibility check. Excluding it from installation.
info @msgpackr-extract/[email protected]: The platform "win32" is incompatible with t
his module.
info "@msgpackr-extract/[email protected]" is an optional dependency and failed compa
tibility check. Excluding it from installation.
info @msgpackr-extract/[email protected]: The CPU architecture "x64" is incompatible
with this module.
info @msgpackr-extract/[email protected]: The platform "win32" is incompatible with
 this module.
info "@msgpackr-extract/[email protected]" is an optional dependency and failed com
patibility check. Excluding it from installation.
info @msgpackr-extract/[email protected]: The CPU architecture "x64" is incompatibl
e with this module.
info @msgpackr-extract/[email protected]: The platform "win32" is incompatible with t
his module.
info "@msgpackr-extract/[email protected]" is an optional dependency and failed compa
tibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > @theia/[email protected]" has unmet peer dependency "electron@^23.2.4".
warning "workspace-aggregator-bdcba8fa-487d-47fc-90a3-dc9ecb4f0f50 > @theia/messages > react-perfect
[email protected]" has unmet peer dependency "react@>=16.3.3".
warning "workspace-aggregator-bdcba8fa-487d-47fc-90a3-dc9ecb4f0f50 > @theia/messages > react-perfect
[email protected]" has unmet peer dependency "react-dom@>=16.3.3".
warning "workspace-aggregator-bdcba8fa-487d-47fc-90a3-dc9ecb4f0f50 > @theia/preview > markdown-it-an
[email protected]" has unmet peer dependency "markdown-it@^8.4.1".
warning "workspace-aggregator-bdcba8fa-487d-47fc-90a3-dc9ecb4f0f50 > @theia/process > [email protected].
0-beta17" has incorrect peer dependency "node-gyp@^8.3.0".
warning "workspace-aggregator-bdcba8fa-487d-47fc-90a3-dc9ecb4f0f50 > @theia/scm > react-autosize-tex
[email protected]" has unmet peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
warning "workspace-aggregator-bdcba8fa-487d-47fc-90a3-dc9ecb4f0f50 > @theia/scm > react-autosize-tex
[email protected]" has unmet peer dependency "react-dom@^0.14.0 || ^15.0.0 || ^16.0.0".
[5/5] Building fresh packages...
[14/19] ⠐ @vscode/ripgrep
[10/19] ⠐ drivelist
[13/19] ⠐ node-pty
[11/19] ⠐ keytar
error E:\NodeJS\theia\node_modules\@vscode\ripgrep: Command failed.
Exit code: 1
Command: node ./lib/postinstall.js
Arguments:
Directory: E:\NodeJS\theia\node_modules\@vscode\ripgrep
Output:
Finding release for v13.0.0-10
GET https://api.github.com/repos/microsoft/ripgrep-prebuilt/releases/tags/v13.0.0-10
Deleting invalid download cache
Downloading ripgrep failed: Error: Request failed: 401
    at ClientRequest.<anonymous> (E:\NodeJS\theia\node_modules\@vscode\ripgrep\lib\download.js:109:2
4)
    at Object.onceWrapper (node:events:629:26)
    at ClientRequest.emit (node:events:514:28)
    at HTTPParser.parserOnIncomingClient (node:_http_client:700:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
    at TLSSocket.socketOnData (node:_http_client:541:22)
    at TLSSocket.emit (node:events:514:28)

@tsmaeder
Copy link
Contributor

@matkuki are you running in Powershell? Can you try cmd.exe?

@matkuki
Copy link
Author

matkuki commented Apr 16, 2024

Hi @tsmaeder , tried it, same error:
image

@matkuki
Copy link
Author

matkuki commented Apr 17, 2024

I'm trying now on a clean Windows machine, but I cannot seem to install the windows-build-tools, described in the instructions here:
https://github.com/eclipse-theia/theia/blob/master/doc/Developing.md#installing-windows-build-tools
Are these instructions up-to-date?

Looking at the instructions again, I remembered that in the above post when I tried building Theia, I didn't install windows-build-tools, just Python3 and VS build tools. Could that be the problem for the above error?

@msujew
Copy link
Member

msujew commented Apr 17, 2024

@matkuki Windows Build Tools are now atuomatically installed with node.js. No need to install them manually anymore. Our documentation says so as well.

@matkuki
Copy link
Author

matkuki commented Apr 17, 2024

@msujew , @tsmaeder
Thanks of all the suggestions. Ok, got Theia built and running in Electron on the clean Windows machine.
The build procedure works, but for Python 3.12 setuptools needs to be manually installed.

The differences between the old and clean Windows machines are:

  • old machine has multiple Visual Studio build tools installed (2017, 2019, 2022)
  • old machine has multiple Python 3's installed (3.7, 3.10 and 3.12: 3.10 is active and on the PATH)
  • old machine has various VS C++ runtimes installed

This are the differences of the top of my head, could anything else be relevant?

@tsmaeder
Copy link
Contributor

For what it's worth, I just got the following on a Build and Test (windows-2019, node-18.x) PR-check job:

[3/5] Fetching packages...
warning [email protected]: The engine "vscode" appears to be invalid.
warning [email protected]: The engine "vscode" appears to be invalid.
warning [email protected]: The engine "vscode" appears to be invalid.
[4/5] Linking dependencies...
warning " > @theia/[email protected]" has unmet peer dependency "electron@^23.2.4".
warning "workspace-aggregator-f335d5e4-b98c-45d1-a7c9-6b7bf63ec5ef > @theia/messages > [email protected]" has unmet peer dependency "react@>=16.3.3".
warning "workspace-aggregator-f335d5e4-b98c-45d1-a7c9-6b7bf63ec5ef > @theia/messages > [email protected]" has unmet peer dependency "react-dom@>=16.3.3".
warning "workspace-aggregator-f335d5e4-b98c-45d1-a7c9-6b7bf63ec5ef > @theia/preview > [email protected]" has unmet peer dependency "markdown-it@^8.4.1".
warning "workspace-aggregator-f335d5e4-b98c-45d1-a7c9-6b7bf63ec5ef > @theia/process > [email protected]" has incorrect peer dependency "node-gyp@^8.3.0".
warning "workspace-aggregator-f335d5e4-b98c-45d1-a7c9-6b7bf63ec5ef > @theia/scm > [email protected]" has unmet peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
warning "workspace-aggregator-f335d5e4-b98c-45d1-a7c9-6b7bf63ec5ef > @theia/scm > [email protected]" has unmet peer dependency "react-dom@^0.14.0 || ^15.0.0 || ^16.0.0".
[5/5] Building fresh packages...
error D:\a\theia\theia\node_modules\node-pty: Command failed.
Exit code: 1
Command: node scripts/install.js
Arguments: 
Directory: D:\a\theia\theia\node_modules\node-pty
Output:
node:internal/child_process:414
    throw errnoException(err, 'spawn');
    ^

Error: spawn EINVAL
    at ChildProcess.spawn (node:internal/child_process:414:11)
    at spawn (node:child_process:761:9)
    at Object.<anonymous> (D:\a\theia\theia\node_modules\node-pty\scripts\install.js:11:20)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
    at node:internal/main/run_main_module:28:49 {
  errno: -4071,
  code: 'EINVAL',
  syscall: 'spawn'
}

Node.js v18.20.2
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error: Process completed with exit code 1.

@msujew
Copy link
Member

msujew commented Apr 17, 2024

@tsmaeder I've created an issue for this, see #13613. It's related to a security "fix" in Node.js that breaks all of our build processes :)

@tsmaeder
Copy link
Contributor

This should be fixed no, right, @msujew ?

@msujew
Copy link
Member

msujew commented Apr 29, 2024

Yes, since the original poster was able to successfully build on a clean install, I think we can close this.

@msujew msujew closed this as completed Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants