为什么 npm i 命令会向终端报错?

时间:2021-04-15 08:32:19

标签: node.js npm

我正在使用 npm i 但它出错了

npm ERR! code 1
npm ERR! path /home/nico/Desktop/myself/my-projects/trans/node_modules/kerberos
npm ERR! command failed
npm ERR! command sh -c prebuild-install || node-gyp rebuild
npm ERR! make: Entering directory '/home/nico/Desktop/myself/my-projects/trans/node_modules/kerberos/build'
npm ERR!   CXX(target) Release/obj.target/kerberos/src/kerberos.o
npm ERR! make: Leaving directory '/home/nico/Desktop/myself/my-projects/trans/node_modules/kerberos/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@15.12.0 | linux | x64
npm ERR! gyp info find Python using Python version 3.8.6 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/nico/.nvm/versions/node/v15.12.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   '/home/nico/Desktop/myself/my-projects/trans/node_modules/kerberos/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/nico/.nvm/versions/node/v15.12.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/nico/.cache/node-gyp/15.12.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=/home/nico/.cache/node-gyp/15.12.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/nico/.nvm/versions/node/v15.12.0/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/nico/.cache/node-gyp/15.12.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/nico/Desktop/myself/my-projects/trans/node_modules/kerberos',
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/kerberos_common.h:7,
npm ERR!                  from ../src/kerberos.h:5,
npm ERR!                  from ../src/kerberos.cc:1:
npm ERR! ../src/unix/kerberos_gss.h:18:14: fatal error: gssapi/gssapi.h: No such file or directory
npm ERR!    18 |     #include <gssapi/gssapi.h>
npm ERR!       |              ^~~~~~~~~~~~~~~~~
npm ERR! compilation terminated.
npm ERR! make: *** [kerberos.target.mk:114: Release/obj.target/kerberos/src/kerberos.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/nico/.nvm/versions/node/v15.12.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:369:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Linux 5.11.0-7612-generic
npm ERR! gyp ERR! command "/home/nico/.nvm/versions/node/v15.12.0/bin/node" "/home/nico/.nvm/versions/node/v15.12.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /home/nico/Desktop/myself/my-projects/trans/node_modules/kerberos
npm ERR! gyp ERR! node -v v15.12.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!     /home/nico/.npm/_logs/2021-04-15T08_14_02_442Z-debug.log

0 个答案:

没有答案