microsoft / node-pty

Fork pseudoterminals in Node.JS
Other
1.43k stars 232 forks source link

Install error on Node 17 #527

Closed jens1101 closed 2 years ago

jens1101 commented 2 years ago

Environment details

Issue description

Under Node 17 when I try to install node-pty I get the following console output:

``` npm ERR! code 1 npm ERR! path /Users/jens/Documents/Projects/Personal/SteamCMD-JS-Interface/node_modules/node-pty npm ERR! command failed npm ERR! command sh -c node scripts/install.js npm ERR! CXX(target) Release/obj.target/pty/src/unix/pty.o npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@8.4.1 npm ERR! gyp info using node@17.5.0 | darwin | x64 npm ERR! gyp info find Python using Python version 3.9.10 found at "/usr/local/opt/python@3.9/bin/python3.9" npm ERR! gyp info spawn /usr/local/opt/python@3.9/bin/python3.9 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/Users/jens/.nvm/versions/node/v17.5.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 '/Users/jens/Documents/Projects/Personal/SteamCMD-JS-Interface/node_modules/node-pty/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/Users/jens/.nvm/versions/node/v17.5.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/Users/jens/Library/Caches/node-gyp/17.5.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=/Users/jens/Library/Caches/node-gyp/17.5.0', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/Users/jens/.nvm/versions/node/v17.5.0/lib/node_modules/npm/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/jens/Library/Caches/node-gyp/17.5.0/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/jens/Documents/Projects/Personal/SteamCMD-JS-Interface/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 ../src/unix/pty.cc:20: npm ERR! In file included from ../../nan/nan.h:2884: npm ERR! ../../nan/nan_typedarray_contents.h:34:43: error: no member named 'GetContents' in 'v8::ArrayBuffer' npm ERR! data = static_cast(buffer->GetContents().Data()) + byte_offset; npm ERR! ~~~~~~~~^ npm ERR! 1 error generated. npm ERR! make: *** [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 (/Users/jens/.nvm/versions/node/v17.5.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:526:28) npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) npm ERR! gyp ERR! System Darwin 21.3.0 npm ERR! gyp ERR! command "/Users/jens/.nvm/versions/node/v17.5.0/bin/node" "/Users/jens/.nvm/versions/node/v17.5.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd /Users/jens/Documents/Projects/Personal/SteamCMD-JS-Interface/node_modules/node-pty npm ERR! gyp ERR! node -v v17.5.0 npm ERR! gyp ERR! node-gyp -v v8.4.1 npm ERR! gyp ERR! not ok npm ERR! A complete log of this run can be found in: npm ERR! /Users/jens/.npm/_logs/2022-02-16T19_37_07_224Z-debug-0.log ```

This doesn't happen on Node <= 16.

This SO answer suggests that GetContents was replaced by GetBackingStore.

Tyriar commented 2 years ago

/duplicate https://github.com/microsoft/node-pty/issues/438