npm install errro-modern/syslog
Published: 2023-09-08 10:31:14

Hi Team,
After updating my nodeJs version to 16.15.1, I am getting below error after running `npm install` command -

```
npm ERR! code 1
npm ERR! path /opt/mount1/cartos/floormap_export/node_modules/modern-syslog
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! make: Entering directory `/opt/mount1/cartos/floormap_export/node_modules/modern-syslog/build'
npm ERR!   CXX(target) Release/obj.target/core/core.o
npm ERR! make: Leaving directory `/opt/mount1/cartos/floormap_export/node_modules/modern-syslog/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.0.0
npm ERR! gyp info using node@16.15.1 | linux | x64
npm ERR! gyp info find Python using Python version 3.6.8 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/cartos/.nvm/versions/node/v16.15.1/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   '/opt/mount1/cartos/floormap_export/node_modules/modern-syslog/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/cartos/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/cartos/.cache/node-gyp/16.15.1/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/cartos/.cache/node-gyp/16.15.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/cartos/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/cartos/.cache/node-gyp/16.15.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/opt/mount1/cartos/floormap_export/node_modules/modern-syslog',
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=gnu++14’
npm ERR! g++: error: unrecognized command line option ‘-std=c++14’
npm ERR! make: *** [Release/obj.target/core/core.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/cartos/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 3.10.0-1160.95.1.el7.x86_64
npm ERR! gyp ERR! command "/home/cartos/.nvm/versions/node/v16.15.1/bin/node" "/home/cartos/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /opt/mount1/cartos/floormap_export/node_modules/modern-syslog
npm ERR! gyp ERR! node -v v16.15.1
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok
```
I have tried all the possible approache to fix the issue but getting same error -
Approach which I have followed till now

- Update node-gyp module (v9.0.0)

- Update g++ compiler

- Update python version to 3.8

- performed npm clean

Nothings worked.

Any kind of help would be appreciated.

Thank you.