报错信息
npm ERR! code 1
npm ERR! path /usr/program/weather-bureau/server-interface/node_modules/sqlite3
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
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 http GET https://nodejs.org/download/release/v14.17.1/node-v14.17.1-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v14.17.1/node-v14.17.1-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v14.17.1/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v14.17.1/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python2
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/program/weather-bureau/server-interface/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/program/weather-bureau/server-interface/node_modules/sqlite3/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/program/weather-bureau/server-interface/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/root/.node-gyp/14.17.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=/root/.node-gyp/14.17.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/program/weather-bureau/server-interface/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.node-gyp/14.17.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/usr/program/weather-bureau/server-interface/node_modules/sqlite3',
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: Undefined variable module_name in binding.gyp while trying to load binding.gyp
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/usr/program/weather-bureau/server-interface/node_modules/node-gyp/lib/configure.js:345:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:375:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
npm ERR! gyp ERR! System Linux 3.10.0-1062.18.1.el7.x86_64
npm ERR! gyp ERR! command "/opt/node-v14.17.1-linux-x64/bin/node" "/usr/program/weather-bureau/server-interface/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /usr/program/weather-bureau/server-interface/node_modules/sqlite3
npm ERR! gyp ERR! node -v v14.17.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-06-30T03_18_46_274Z-debug.log解决方案
安装cnpm,在项目目录下执行cnpm install
[sqlite3] Success: "/usr/program/weather-bureau/server-interface/node_modules/[email protected]@sqlite3/lib/binding/napi-v3-linux-x64/node_sqlite3.node" is installed via remote
[1/1] scripts.install sqlite3@^5.0.1 finished in 986ms
✔ Run 1 scripts
deprecate [email protected] › node-pre-gyp@^0.11.0 Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
deprecate [email protected] › [email protected] › request@^2.87.0 request has been deprecated, see https://github.com/request/request/issues/3142
deprecate [email protected] › [email protected] › [email protected] › har-validator@~5.1.3 this library is no longer supported
✔ All packages installed (127 packages installed from npm registry, used 4s(network 3s), speed 1.86MB/s, json 118(260.41kB), tarball 5.16MB)根据提示,安装node-pre-gyp和node-gypnpm install node-pre-gyp -g
npm install node-gyp -g进入node_modules/sqlite3目录,执行node-pre-gyp rebuild即可cd node_modules/sqlite3/
node-pre-gyp rebuild
DISCUSSION
评论
还没有公开评论,欢迎留下想法。