Skip to content

Can't npm install node-pty #735

Closed
Closed

Description

@Mewax07
npm i node-pty 
npm error code 7
npm error path D:\MewaxAllApp\OptiumStudio\TEST4\node_modules\node-pty
npm error command failed
npm error command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild
npm error gyp info it worked if it ends with ok
npm error gyp info using node-gyp@6.1.0
npm error gyp info using node@20.12.2 | win32 | x64
npm error gyp info find Python using Python version 3.12.3 found at "C:\Python312\python.exe"
npm error gyp info find VS using VS2019 (16.11.34729.46) found at:
npm error gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
npm error gyp info find VS run with --verbose for detailed information
npm error gyp ERR! UNCAUGHT EXCEPTION
npm error gyp ERR! stack TypeError: Cannot assign to read only property 'cflags' of object '#<Object>'
npm error gyp ERR! stack     at createConfigFile (D:\MewaxAllApp\OptiumStudio\TEST4\node_modules\node-gyp\lib\configure.js:118:21)
npm error gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
npm error gyp ERR! System Windows_NT 10.0.22631
npm error gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\MewaxAllApp\\OptiumStudio\\TEST4\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"  
npm error gyp ERR! cwd D:\MewaxAllApp\OptiumStudio\TEST4\node_modules\node-pty
npm error gyp ERR! node -v v20.12.2
npm error gyp ERR! node-gyp -v v6.1.0
npm error gyp ERR! This is a bug in `node-gyp`.
npm error gyp ERR! Try to update node-gyp and file an Issue if it does not help:
npm error gyp ERR!     <https://github.com/nodejs/node-gyp/issues>
npm error A complete log of this run can be found in: C:\Users\ant-1\AppData\Local\npm-cache\_logs\2024-12-01T20_17_22_893Z-debug-0.log

my json package :

{
  "name": "optium-studio",
  "version": "1.23.1",
  "main": "main.js",
  "devDependencies": {
    "electron": "^32.2.2",
    "electron-rebuild": "^1.11.0",
    "electron-tools": "^2.4.2"
  },
  "scripts": {
    "start": "electron .",
    "rebuild": "electron-rebuild -f -w node-pty"
  },
  "author": "MewaxCorp",
  "license": "ISC",
  "description": "",
  "dependencies": {
    "@vscode/codicons": "^0.0.36",
    "fs": "^0.0.1-security",
    "monaco-editor": "^0.52.0",
    "monaco-emmet": "^3.1.1",
    "path": "^0.12.7",
    "xterm": "^5.3.0"
  }
}

Activity

  1. TeamPSS commented on Dec 3, 2024

    @TeamPSS

    I too have a similar problem with installing node-pty
    PS C:\Users\Siva\Documents\Test> npm i node-pty@1.0.0 --save npm error code 1 npm error path C:\Users\Siva\Documents\Test\node_modules\node-pty npm error command failed npm error command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild npm error Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch. npm error conpty.cc npm error path_util.cc npm error win_delay_load_hook.cc npm error Generating code npm error Previous IPDB not found, fall back to full compilation. npm error All 1049 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. npm error Finished generating code npm error conpty.vcxproj -> C:\Users\Siva\Documents\Test\node_modules\node-pty\build\Release\\conpty.node npm error conpty_console_list.cc npm error win_delay_load_hook.cc npm error Generating code npm error Previous IPDB not found, fall back to full compilation. npm error All 241 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. npm error Finished generating code npm error conpty_console_list.vcxproj -> C:\Users\Siva\Documents\Test\node_modules\node-pty\build\Release\\conpty_console_list.node npm error Agent.cc npm error AgentCreateDesktop.cc npm error ConsoleFont.cc npm error ConsoleInput.cc npm error ConsoleInputReencoding.cc npm error ConsoleLine.cc npm error DebugShowInput.cc npm error DefaultInputMap.cc npm error EventLoop.cc npm error InputMap.cc npm error LargeConsoleRead.cc npm error NamedPipe.cc npm error Scraper.cc npm error Terminal.cc npm error Win32Console.cc npm error Win32ConsoleBuffer.cc npm error main.cc npm error BackgroundDesktop.cc npm error Buffer.cc npm error DebugClient.cc npm error GenRandom.cc npm error OwnedHandle.cc npm error StringUtil.cc npm error WindowsSecurity.cc npm error WindowsVersion.cc npm error WinptyAssert.cc npm error WinptyException.cc npm error WinptyVersion.cc npm error win_delay_load_hook.cc npm error Generating code npm error Previous IPDB not found, fall back to full compilation. npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\deps\winpty\src\agent\Agent.cc(231): warning C4722: 'Agent::~Agent': destructor never returns, potential memory leak [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\deps\winpty\src\winpty-agent.vcxproj] npm error All 1815 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. npm error Finished generating code npm error winpty-agent.vcxproj -> C:\Users\Siva\Documents\Test\node_modules\node-pty\build\Release\\winpty-agent.exe npm error AgentLocation.cc npm error winpty.cc npm error BackgroundDesktop.cc npm error Buffer.cc npm error DebugClient.cc npm error GenRandom.cc npm error OwnedHandle.cc npm error StringUtil.cc npm error WindowsSecurity.cc npm error WindowsVersion.cc npm error WinptyAssert.cc npm error WinptyException.cc npm error WinptyVersion.cc npm error win_delay_load_hook.cc npm error Creating library C:\Users\Siva\Documents\Test\node_modules\node-pty\build\Release\winpty.lib and object C:\Users\Siva\Documents\Test\node_modules\node-pty\build\Release\winpty.exp npm error Generating code npm error Previous IPDB not found, fall back to full compilation. npm error All 1072 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. npm error Finished generating code npm error winpty.vcxproj -> C:\Users\Siva\Documents\Test\node_modules\node-pty\build\Release\\winpty.dll npm error winpty.cc npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(43,55): warning C4311: 'type cast': pointer truncation from 'HANDLE' to 'int' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(43,55): warning C4302: 'type cast': truncation from 'HANDLE' to 'int' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(54,8): warning C4311: 'type cast': pointer truncation from 'HANDLE' to 'int' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(54,8): warning C4302: 'type cast': truncation from 'HANDLE' to 'int' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(109,26): warning C4018: '<': signed/unsigned mismatch [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(220,110): warning C4311: 'type cast': pointer truncation from 'HANDLE' to 'int' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(220,110): warning C4302: 'type cast': truncation from 'HANDLE' to 'int' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(221,117): warning C4311: 'type cast': pointer truncation from 'HANDLE' to 'int' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(221,117): warning C4302: 'type cast': truncation from 'HANDLE' to 'int' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(238,1): error C2362: initialization of 'marshal' is skipped by 'goto cleanup' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(218): message : see declaration of 'marshal' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(238): message : see declaration of 'cleanup' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(238,1): error C2362: initialization of 'spawnSuccess' is skipped by 'goto cleanup' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(209): message : see declaration of 'spawnSuccess' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(238): message : see declaration of 'cleanup' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(238,1): error C2362: initialization of 'handle' is skipped by 'goto cleanup' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(208): message : see declaration of 'handle' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(238): message : see declaration of 'cleanup' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(238,1): error C2362: initialization of 'config' is skipped by 'goto cleanup' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(200): message : see declaration of 'config' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(238): message : see declaration of 'cleanup' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(238,1): error C2362: initialization of 'pc' is skipped by 'goto cleanup' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(188): message : see declaration of 'pc' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(238): message : see declaration of 'cleanup' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(238,1): error C2362: initialization of 'winpty_config' is skipped by 'goto cleanup' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(177): message : see declaration of 'winpty_config' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(238): message : see declaration of 'cleanup' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(238,1): error C2362: initialization of 'error_ptr' is skipped by 'goto cleanup' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(176): message : see declaration of 'error_ptr' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(238): message : see declaration of 'cleanup' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(238,1): error C2362: initialization of 'debug' is skipped by 'goto cleanup' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(170): message : see declaration of 'debug' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(238): message : see declaration of 'cleanup' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(238,1): error C2362: initialization of 'rows' is skipped by 'goto cleanup' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(169): message : see declaration of 'rows' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(238): message : see declaration of 'cleanup' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(238,1): error C2362: initialization of 'cols' is skipped by 'goto cleanup' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(168): message : see declaration of 'cols' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(238): message : see declaration of 'cleanup' [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error C:\Users\Siva\Documents\Test\node_modules\node-pty\src\win\winpty.cc(285,91): warning C4312: 'type cast': conversion from 'T' to 'HANDLE' of greater size [C:\Users\Siva\Documents\Test\node_modules\node-pty\build\pty.vcxproj] npm error with npm error [ npm error T=int32_t npm error ] npm error gyp info it worked if it ends with ok npm error gyp info using node-gyp@10.3.1 npm error gyp info using node@22.11.0 | win32 | x64 npm error gyp info find Python using Python version 3.12.6 found at "C:\Python312\python.exe" npm error gyp info find VS using VS2019 (16.11.35425.106) found at: npm error gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools" npm error gyp info find VS run with --verbose for detailed information npm error gyp info spawn C:\Python312\python.exe npm error gyp info spawn args [ npm error gyp info spawn args 'C:\\Users\\Siva\\Documents\\Test\\node_modules\\node-gyp\\gyp\\gyp_main.py', npm error gyp info spawn args 'binding.gyp', npm error gyp info spawn args '-f', npm error gyp info spawn args 'msvs', npm error gyp info spawn args '-I', npm error gyp info spawn args 'C:\\Users\\Siva\\Documents\\Test\\node_modules\\node-pty\\build\\config.gypi', npm error gyp info spawn args '-I', npm error gyp info spawn args 'C:\\Users\\Siva\\Documents\\Test\\node_modules\\node-gyp\\addon.gypi', npm error gyp info spawn args '-I', npm error gyp info spawn args 'C:\\Users\\Siva\\AppData\\Local\\node-gyp\\Cache\\22.11.0\\include\\node\\common.gypi', npm error gyp info spawn args '-Dlibrary=shared_library', npm error gyp info spawn args '-Dvisibility=default', npm error gyp info spawn args '-Dnode_root_dir=C:\\Users\\Siva\\AppData\\Local\\node-gyp\\Cache\\22.11.0', npm error gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\Siva\\Documents\\Test\\node_modules\\node-gyp', npm error gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\Siva\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\22.11.0\\\\<(target_arch)\\\\node.lib', npm error gyp info spawn args '-Dmodule_root_dir=C:\\Users\\Siva\\Documents\\Test\\node_modules\\node-pty', npm error gyp info spawn args '-Dnode_engine=v8', npm error gyp info spawn args '--depth=.', npm error gyp info spawn args '--no-parallel', npm error gyp info spawn args '--generator-output', npm error gyp info spawn args 'C:\\Users\\Siva\\Documents\\Test\\node_modules\\node-pty\\build', npm error gyp info spawn args '-Goutput_dir=.' npm error gyp info spawn args ] npm error gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe npm error gyp info spawn args [ npm error gyp info spawn args 'build\\binding.sln', npm error gyp info spawn args '/clp:Verbosity=minimal', npm error gyp info spawn args '/nologo', npm error gyp info spawn args '/p:Configuration=Release;Platform=x64' npm error gyp info spawn args ] npm error gyp ERR! build error npm error gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe failed with exit code: 1 npm error gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\Siva\Documents\Test\node_modules\node-gyp\lib\build.js:216:23) npm error gyp ERR! stack at ChildProcess.emit (node:events:518:28) npm error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12) npm error gyp ERR! System Windows_NT 10.0.26100 npm error gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Siva\\Documents\\Test\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" npm error gyp ERR! cwd C:\Users\Siva\Documents\Test\node_modules\node-pty npm error gyp ERR! node -v v22.11.0 npm error gyp ERR! node-gyp -v v10.3.1 npm error gyp ERR! not ok

  2. YeesterPlus commented on Dec 11, 2024

    @YeesterPlus

    use parenthesies in build process

  3. locked and limited conversation to collaborators on Dec 17, 2024
  4. converted this issue into a discussion #744 on Dec 17, 2024
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions