microsoft / node-pty

Fork pseudoterminals in Node.JS
Other
1.46k stars 235 forks source link

support for Node 17 #501

Closed SimonSiefke closed 2 years ago

SimonSiefke commented 2 years ago

Environment details

Issue description

While node-pty installation works with Node 16.11.1, node-pty fails to install with Node 17.0.0:

simon node-pty-example $ node -v
v17.0.0
simon node-pty-example $ npm install node-pty
npm ERR! code 1
npm ERR! path /tmp/node-pty-example/node_modules/node-pty
npm ERR! command failed
npm ERR! command sh -c node scripts/install.js
npm ERR! make: Entering directory '/tmp/node-pty-example/node_modules/node-pty/build'
npm ERR!   CXX(target) Release/obj.target/pty/src/unix/pty.o
npm ERR! make: Leaving directory '/tmp/node-pty-example/node_modules/node-pty/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.2.0
npm ERR! gyp info using node@17.0.0 | linux | x64
npm ERR! gyp info find Python using Python version 3.9.5 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/home/simon/.nvm/versions/node/v17.0.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/tmp/node-pty-example/node_modules/node-pty/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/simon/.nvm/versions/node/v17.0.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/simon/.cache/node-gyp/17.0.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/simon/.cache/node-gyp/17.0.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/simon/.nvm/versions/node/v17.0.0/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/simon/.cache/node-gyp/17.0.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/tmp/node-pty-example/node_modules/node-pty',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from /home/simon/.cache/node-gyp/17.0.0/include/node/v8-object.h:10,
npm ERR!                  from /home/simon/.cache/node-gyp/17.0.0/include/node/v8-array-buffer.h:13,
npm ERR!                  from /home/simon/.cache/node-gyp/17.0.0/include/node/v8.h:25,
npm ERR!                  from /home/simon/.cache/node-gyp/17.0.0/include/node/node.h:63,
npm ERR!                  from ../../nan/nan.h:58,
npm ERR!                  from ../src/unix/pty.cc:20:
npm ERR! /home/simon/.cache/node-gyp/17.0.0/include/node/v8-persistent-handle.h:10:10: fatal error: v8-weak-callback-info.h: No such file or directory
npm ERR!    10 | #include "v8-weak-callback-info.h"  // NOLINT(build/include_directory)
npm ERR!       |          ^~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! compilation terminated.
npm ERR! make: *** [pty.target.mk:113: Release/obj.target/pty/src/unix/pty.o] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/home/simon/.nvm/versions/node/v17.0.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Linux 5.11.0-38-generic
npm ERR! gyp ERR! command "/home/simon/.nvm/versions/node/v17.0.0/bin/node" "/home/simon/.nvm/versions/node/v17.0.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /tmp/node-pty-example/node_modules/node-pty
npm ERR! gyp ERR! node -v v17.0.0
npm ERR! gyp ERR! node-gyp -v v8.2.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/simon/.npm/_logs/2021-10-19T21_15_03_740Z-debug.log
Tyriar commented 2 years ago

Node 15 is tracked in https://github.com/microsoft/node-pty/issues/438, one step at a time 🙂. We'll action this when Electron is updated in VS Code