Closed kongyijilafumi closed 11 months ago
关键错误:g++: error: unrecognized command line option ‘-std=gnu++14’
Readme 安装依赖部分已经说了:
若安装依赖过程中出现因utf-8-validate包编译失败的错误,请尝试搜索相关错误解决,若实在无法解决,则可以编辑package.json文件删除dependencies下的utf-8-validate后,重新运行npm install --omit=dev或npm install即可
好的,我使用了npm remove utf-8-validate
,然后重新npm i
就成功了,谢谢了
npm ERR! code 1 npm ERR! path /root/lx-music-sync-server/node_modules/utf-8-validate npm ERR! command failed npm ERR! command sh -c node-gyp-build npm ERR! make: Entering directory
/root/lx-music-sync-server/node_modules/utf-8 -validate/build' npm ERR! CXX(target) Release/obj.target/validation/src/validation.o npm ERR! make: Leaving directory
/root/lx-music-sync-server/node_modules/utf-8- validate/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.16.0 | linux | x64 npm ERR! gyp info find Python using Python version 3.6.8 found at "/usr/bin/pyth on3" npm ERR! gyp info spawn /usr/bin/python3 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/root/.nvm/versions/node/v16.16.0/lib/node_modul es/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 '/root/lx-music-sync-server/node_modules/utf-8-va lidate/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/root/.nvm/versions/node/v16.16.0/lib/node_modul es/npm/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/root/.cache/node-gyp/16.16.0/include/node/commo n.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=/root/.cache/node-gyp/16.16.0', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/root/.nvm/versions/node/v16.16.0 /lib/node_modules/npm/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/16.16.0/<( target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/root/lx-music-sync-server/nod e_modules/utf-8-validate', 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! make: *** [Release/obj.target/validation/src/validation.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 (/root/.nvm/versions/node/v16 .16.0/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:interna l/child_process:291:12) npm ERR! gyp ERR! System Linux 3.10.0-1160.45.1.el7.x86_64 npm ERR! gyp ERR! command "/root/.nvm/versions/node/v16.16.0/bin/node" "/root/.n vm/versions/node/v16.16.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gy p.js" "rebuild" npm ERR! gyp ERR! cwd /root/lx-music-sync-server/node_modules/utf-8-validate npm ERR! gyp ERR! node -v v16.16.0 npm ERR! gyp ERR! node-gyp -v v9.0.0 npm ERR! gyp ERR! not oknpm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2023-09-09T14_54_26_660Z-debug-0.log [root@VM-16-16-centos lx-music-sync-server]# npm i npm ERR! code 1 npm ERR! path /root/lx-music-sync-server/node_modules/utf-8-validate npm ERR! command failed npm ERR! command sh -c node-gyp-build npm ERR! make: Entering directory
/root/lx-music-sync-server/node_modules/utf-8-validate/build' npm ERR! CXX(target) Release/obj.target/validation/src/validation.o npm ERR! make: Leaving directory
/root/lx-music-sync-server/node_modules/utf-8-validate/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.16.0 | 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 '/root/.nvm/versions/node/v16.16.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 '/root/lx-music-sync-server/node_modules/utf-8-validate/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/root/.nvm/versions/node/v16.16.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/root/.cache/node-gyp/16.16.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=/root/.cache/node-gyp/16.16.0', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/root/.nvm/versions/node/v16.16.0/lib/node_modules/npm/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/16.16.0/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/root/lx-music-sync-server/node_modules/utf-8-validate', 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! make: *** [Release/obj.target/validation/src/validation.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 (/root/.nvm/versions/node/v16.16.0/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.45.1.el7.x86_64 npm ERR! gyp ERR! command "/root/.nvm/versions/node/v16.16.0/bin/node" "/root/.nvm/versions/node/v16.16.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd /root/lx-music-sync-server/node_modules/utf-8-validate npm ERR! gyp ERR! node -v v16.16.0 npm ERR! gyp ERR! node-gyp -v v9.0.0 npm ERR! gyp ERR! not ok