I just created a new project in nodejs(ubuntu 18) with npm init.
After I try to install re2 I get an error. What am I doing wrong?
npm install --save re2
npm ERR! code 1
npm ERR! path /home/luiz/izing/backend/node_modules/re2
npm ERR! command failed
npm ERR! command sh -c -- install-from-cache --artifact build/Release/re2.node --host-var RE2_DOWNLOAD_MIRROR --skip-path-var RE2_DOWNLOAD_SKIP_PATH --skip-ver-var RE2_DOWNLOAD_SKIP_VER || npm run rebuild
npm ERR! Trying https://github.com/uhop/node-re2/releases/download/1.20.9/linux-x64-93.br ...
npm ERR! Trying https://github.com/uhop/node-re2/releases/download/1.20.9/linux-x64-93.gz ...
npm ERR! Building locally ...
npm ERR!
npm ERR! > [email protected] rebuild
npm ERR! > node-gyp rebuild
npm ERR!
npm ERR!
npm ERR! make: Entering directory '/home/luiz/izing/backend/node_modules/re2/build'
npm ERR! CXX(target) Release/obj.target/re2/lib/addon.o
npm ERR! re2.target.mk:237: recipe for target 'Release/obj.target/re2/lib/addon.o' failed
npm ERR! make: Leaving directory '/home/luiz/izing/backend/node_modules/re2/build'
npm ERR!
npm ERR! > [email protected] rebuild
npm ERR! > node-gyp rebuild
npm ERR!
npm ERR!
npm ERR! make: Entering directory '/home/luiz/izing/backend/node_modules/re2/build'
npm ERR! CXX(target) Release/obj.target/re2/lib/addon.o
npm ERR! re2.target.mk:237: recipe for target 'Release/obj.target/re2/lib/addon.o' failed
npm ERR! make: Leaving directory '/home/luiz/izing/backend/node_modules/re2/build'
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] | linux | x64
npm ERR! gyp info find Python using Python version 3.6.9 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/luiz/izing/backend/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 '/home/luiz/izing/backend/node_modules/re2/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/luiz/izing/backend/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/luiz/.cache/node-gyp/16.20.2/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/luiz/.cache/node-gyp/16.20.2',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/home/luiz/izing/backend/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/home/luiz/.cache/node-gyp/16.20.2/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/luiz/izing/backend/node_modules/re2',
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! g++: error: unrecognized command line option ‘-std=c++2a’; did you mean ‘-std=c++03’?
npm ERR! make: *** [Release/obj.target/re2/lib/addon.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.<anonymous> (/home/luiz/izing/backend/node_modules/node-gyp/lib/build.js:209:23)
npm ERR! gyp ERR! System Linux 4.15.0-156-generic
npm ERR! gyp ERR! command "/home/luiz/.nvm/versions/node/v16.20.2/bin/node" "/home/luiz/izing/backend/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /home/luiz/izing/backend/node_modules/re2
npm ERR! gyp ERR! node -v v16.20.2
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok
npm ERR! node:internal/process/promises:279
npm ERR! triggerUncaughtException(err, true /* fromPromise */);
npm ERR! ^
npm ERR!
npm ERR! [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "1".] {
npm ERR! code: 'ERR_UNHANDLED_REJECTION'
npm ERR! }
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] | linux | x64
npm ERR! gyp info find Python using Python version 3.6.9 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/luiz/izing/backend/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 '/home/luiz/izing/backend/node_modules/re2/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/luiz/izing/backend/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/luiz/.cache/node-gyp/16.20.2/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/luiz/.cache/node-gyp/16.20.2',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/home/luiz/izing/backend/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/home/luiz/.cache/node-gyp/16.20.2/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/luiz/izing/backend/node_modules/re2',
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! g++: error: unrecognized command line option ‘-std=c++2a’; did you mean ‘-std=c++03’?
npm ERR! make: *** [Release/obj.target/re2/lib/addon.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.<anonymous> (/home/luiz/izing/backend/node_modules/node-gyp/lib/build.js:209:23)
npm ERR! gyp ERR! System Linux 4.15.0-156-generic
npm ERR! gyp ERR! command "/home/luiz/.nvm/versions/node/v16.20.2/bin/node" "/home/luiz/izing/backend/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /home/luiz/izing/backend/node_modules/re2
npm ERR! gyp ERR! node -v v16.20.2
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! /home/luiz/.npm/_logs/2023-12-25T22_35_57_558Z-debug-0.log