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

node-pty install is failed with gyp ERR #3077

Open
WhityGhost opened this issue Oct 7, 2024 · 8 comments
Open

node-pty install is failed with gyp ERR #3077

WhityGhost opened this issue Oct 7, 2024 · 8 comments
Labels

Comments

@WhityGhost
Copy link

I'm using node v20.17.0 and node-gyp is up-to-date (using v10.2.0)
But whenever I try to install dependencies for my project, I get this error output.

Node-gyp output:
gyp info using [email protected] | win32 | x64
gyp info find Python using Python version 3.12.4 found at "C:\Users\USER\AppData\Local\Programs\Python\Python312\python.exe"
gyp info find VS using VS2022 (17.10.35013.160) 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 C:\Users\USER\AppData\Local\Programs\Python\Python312\python.exe
gyp info spawn args [
gyp info spawn args 'C:\\Users\\USER\\AppData\\Roaming\\nvm\\v20.17.0\\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 'D:\\_Workspace\\Development\\Web\\Nextjs\\hackerium-project\\website\\node_modules\\node-pty\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\USER\\AppData\\Roaming\\nvm\\v20.17.0\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\USER\\AppData\\Local\\node-gyp\\Cache\\20.17.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=C:\\Users\\USER\\AppData\\Local\\node-gyp\\Cache\\20.17.0',
gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\USER\\AppData\\Roaming\\nvm\\v20.17.0\\node_modules\\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\USER\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\20.17.0\\\\<(target_arch)\\\\node.lib',
gyp info spawn args '-Dmodule_root_dir=D:\\_Workspace\\Development\\Web\\Nextjs\\hackerium-project\\website\\node_modules\\node-pty',
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 'D:\\_Workspace\\Development\\Web\\Nextjs\\hackerium-project\\website\\node_modules\\node-pty\\build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
gyp info spawn args [
gyp info spawn args 'build\\binding.sln',
gyp info spawn args '/clp:Verbosity=minimal',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64'
gyp info spawn args ]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\USER\AppData\Roaming\nvm\v20.17.0\node_modules\node-gyp\lib\build.js:216:23)
gyp ERR! stack at ChildProcess.emit (node:events:519:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
gyp ERR! System Windows_NT 10.0.22631
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\_Workspace\Development\Web\Nextjs\hackerium-project\website\node_modules\node-pty
gyp ERR! node -v v20.17.0
gyp ERR! node-gyp -v v10.2.0
gyp ERR! not ok

error: install script from "node-pty" exited with 1

I used bun v1.1.21 for installation.
I tried to remove the packages installed and reinstall node-gyp, but all didn't work.
Any help please...
Thank you.

@cclauss cclauss added the Windows label Oct 7, 2024
@huseyinacacak-janea
Copy link
Contributor

I'm not able to reproduce it with the given information. Could you please provide a minimal example so that it can be reproduced locally?

@cclauss cclauss changed the title module install is failed with gyp ERR node-pty install is failed with gyp ERR Oct 10, 2024
@cclauss
Copy link
Contributor

cclauss commented Oct 10, 2024

26 node-pty issues

@huseyinacacak-janea
Copy link
Contributor

As can be seen from this link, the current node-pty release supports only Node.js v16. In your case, you try to use it with Node.js v20.
What can be done to use it with the latest versions of Node.js is to use node-pty@beta. Could you please try to install the module with this version in your project?

@WhityGhost
Copy link
Author

WhityGhost commented Oct 14, 2024

Thank you for your reply
but installing node-pty@beta shows the same error

And installing node-pty in new empty directory fails with the same error as well

@cclauss
Copy link
Contributor

cclauss commented Oct 14, 2024

Perhaps upgrade the tests from Node.js v18 to 20 or 22.

https://github.com/microsoft/node-pty/blob/main/azure-pipelines.yml

@Tyriar

@huseyinacacak-janea
Copy link
Contributor

Thank you for your reply but installing node-pty@beta shows the same error

And installing node-pty in new empty directory fails with the same error as well

I created an empty folder and ran the following commands inside:

  • npm init
  • npm install node-pty@beta

The installation was successful with the latest versions of Node.js (v22.9.0, v20.18.0 and v18.20.4). So, I'm not able to reproduce it locally. Could you write down the commands that you've run?

@Tyriar
Copy link

Tyriar commented Oct 14, 2024

node-pty definitely works on node 20, that's what I use everyday.

I used bun v1.1.21 for installation.

Last time I heard there were problems with bun and node-gyp/NAPI? microsoft/node-pty#632

@cclauss
Copy link
Contributor

cclauss commented Oct 14, 2024

Thanks for your work on node-pyt and your quick response here!

napi is a frequently reported problem.

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