terminalizer icon indicating copy to clipboard operation
terminalizer copied to clipboard

Can't install on macOS 11.3: `template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv`

Open AlexanderWillner opened this issue 3 years ago • 4 comments

Version: 0.7.2 Version OS: macOS 11.3

Steps that will reproduce the problem?

  1. npm install -g terminalizer

What is the expected result?

  • Installed binary

What happens instead?

  • Error in node-pty-prebuilt: template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv

Possible workaround:

  • Unknown

Any additional information:

  • npm install -g node-pty works
  • Details:
% npm install -g terminalizer
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 1
npm ERR! path /usr/local/lib/node_modules/terminalizer/node_modules/@faressoft/node-pty-prebuilt
npm ERR! command failed
npm ERR! command sh -c prebuild-install || 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 [email protected]
npm ERR! gyp info using [email protected] | darwin | x64
npm ERR! gyp info find Python using Python version 3.9.4 found at "/usr/local/opt/[email protected]/bin/python3.9"
npm ERR! (node:5721) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp info spawn /usr/local/opt/[email protected]/bin/python3.9
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/local/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   '/usr/local/lib/node_modules/terminalizer/node_modules/@faressoft/node-pty-prebuilt/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/awi/Library/Caches/node-gyp/16.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=/Users/awi/Library/Caches/node-gyp/16.0.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/awi/Library/Caches/node-gyp/16.0.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/usr/local/lib/node_modules/terminalizer/node_modules/@faressoft/node-pty-prebuilt',
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:56:
npm ERR! In file included from /Users/awi/Library/Caches/node-gyp/16.0.0/include/node/node.h:63:
npm ERR! In file included from /Users/awi/Library/Caches/node-gyp/16.0.0/include/node/v8.h:30:
npm ERR! /Users/awi/Library/Caches/node-gyp/16.0.0/include/node/v8-internal.h:452:38: error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'remove_cv'?
npm ERR!             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR!                                 ~~~~~^~~~~~~~~~~
npm ERR!                                      remove_cv
npm ERR! /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:776:50: note: 'remove_cv' declared here
npm ERR! template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 20.4.0
npm ERR! gyp ERR! command "/usr/local/Cellar/node/16.0.0_1/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /usr/local/lib/node_modules/terminalizer/node_modules/@faressoft/node-pty-prebuilt
npm ERR! gyp ERR! node -v v16.0.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/awi/.npm/_logs/2021-05-02T15_19_45_913Z-debug.log

AlexanderWillner avatar May 02 '21 15:05 AlexanderWillner

This error is caused by node version, or specifically, underground C++ version.

You can find more information or temporary solution from: https://github.com/microsoft/node-pty/issues/441

TLDay avatar May 08 '21 07:05 TLDay

As for myself, I changed remove_cv_t to remove_cv at /Users/awi/Library/Caches/node-gyp/16.0.0/include/node/v8-internal.h:452:38, after terminalizer installed, change it back.

TLDay avatar May 08 '21 07:05 TLDay

Thanks, this was really helpful! Seems that https://github.com/faressoft/terminalizer/blob/fb079fc3e4a2a7e4939c65f9fe29c7fc96e1a73d/package.json#L44 should then be updated sooner or later to version 0.10.0 ...

AlexanderWillner avatar May 08 '21 08:05 AlexanderWillner

Installing Node v12.21.0 solves the issue

eavilaes avatar Oct 22 '21 10:10 eavilaes