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

Error C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1 #3068

Open
Corristo-X opened this issue Sep 8, 2024 · 8 comments
Labels

Comments

@Corristo-X
Copy link

Corristo-X commented Sep 8, 2024

Error: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe failed with exit code: 1
at ChildProcess.onExit (D:\RoboOptim\RoboOptim\node_modules@electron\rebuild\node_modules\node-gyp\lib\build.js:203:23)
at ChildProcess.emit (node:events:517:28)
at ChildProcess._handle.onexit (node:internal/child_process:292:12)

✖ Rebuild Failed

An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild 'D:\RoboOptim\RoboOptim\node_modules\canvas'

Error: node-gyp failed to rebuild 'D:\RoboOptim\RoboOptim\node_modules\canvas'
at ChildProcess. (D:\RoboOptim\RoboOptim\node_modules@electron\rebuild\lib\module-type\node-gyp\node-gyp.js:118:24)
at ChildProcess.emit (node:events:517:28)
at ChildProcess._handle.onexit (node:internal/child_process:292:12)

node-gyp v10.2.0
node v17.9.1/ same error on node v20.17.0
windows 11
on linux mint the program works fine for me.

@Corristo-X Corristo-X changed the title Erro C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1 Error C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1 Sep 8, 2024
@cclauss cclauss added the Windows label Sep 8, 2024
@cclauss
Copy link
Contributor

cclauss commented Sep 8, 2024

You might want to look at the Windows steps at https://github.com/Automattic/node-canvas/blob/master/.github/workflows/ci.yaml#L31

Please do not post screenshot images because they are not searchable.

@Corristo-X
Copy link
Author

Corristo-X commented Sep 8, 2024

@cclauss unfortunately nothing helped from this link

@turbidwater
Copy link

I am in the same boat. I have tried downgrading both node and node-gyp to the versions indicated in the link and still am running into the error. Mine is while trying to build libdvbtee_parser. I'm using Python 3.13.0, Visual Studio 2022 with the C for Desktop workload, and node 18.12.0 and node-gyp 8 installed globally.

@cclauss
Copy link
Contributor

cclauss commented Oct 31, 2024

Python 3.12 and 3.13 will break node-gyp < v10 because the need setuptools. See what!s new in Python 3.12 for details.

@turbidwater
Copy link

Thanks for the quick response! I downgraded python to 3.11 and am still encountering the same issues:

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   '/m:8'
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 (C:\Users\nthin\AppData\Roaming\nvm\v18.12.0\node_modules\npm\node_modules\node-gyp\lib\build.js:201:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Windows_NT 10.0.26100
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\nthin\\AppData\\Roaming\\nvm\\v18.12.0\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "-j" "8"
npm ERR! gyp ERR! cwd C:\_projects\THEO\THEOplayer\src\theoplayer-next\web\streams\node_modules\libdvbtee_parser
npm ERR! gyp ERR! node -v v18.12.0
npm ERR! gyp ERR! node-gyp -v v9.1.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\nthin\AppData\Local\npm-cache\_logs\2024-10-31T18_44_30_337Z-debug-0.log

I notice that the node-gyp version is listed in the output as 9.1.0, yet I've only installed 8.4.1, and that's the version in my nodejs install.

@cclauss
Copy link
Contributor

cclauss commented Oct 31, 2024

https://github.com/nodejs/node-gyp/blob/main/docs/Updating-npm-bundled-node-gyp.md#updating-the-npm-bundled-version-of-node-gyp

npm bundles its own, internal, copy of node-gyp.

Also, look at package.json and package-lock.json files in the local directories.

@turbidwater
Copy link

Thanks for the suggestion. Following that I was able to get it to use v8.4.1. That then asked for a Windows SDK for Visual Studio, which I installed and now I am back at the same place:

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   '/m:8'
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 (C:\Users\nthin\AppData\Roaming\nvm\v18.12.0\node_modules\npm\node_modules\@npmcli\run-script\node_modules\node-gyp\lib\build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Windows_NT 10.0.26100
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\nthin\\AppData\\Roaming\\nvm\\v18.12.0\\node_modules\\npm\\node_modules\\@npmcli\\run-script\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "-j" "8"
npm ERR! gyp ERR! cwd C:\_projects\web\streams\node_modules\libdvbtee_parser
npm ERR! gyp ERR! node -v v18.12.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok

Any other suggestions?

@gongyuan300
Copy link

Python 3.12 和 3.13 将破坏 node-gyp < v10,因为需要setuptools。有关详细信息,请参阅 Python 3.12 中的新增功能。

这个是啥意思,是说安装python3.12以上版本后,环境会被破坏吗导致打包失败

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants