每当我尝试部署我的discord.js机器人时,我得到一个错误Failed at the lzma-native@3.0.8 install script
,我指定了node.js版本,我试图指定npm版本,但我仍然得到相同的问题。我正在使用Node.js 14.15.4
和npm 6.14.10
这里是完整的日志:
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): 14.x
engines.npm (package.json): unspecified (use default)
Resolving node version 14.x...
Downloading and installing node 14.15.4...
Using default npm version: 6.14.10
-----> Installing dependencies
Installing node modules
> nodemon@2.0.7 postinstall /tmp/build_96ae59ea_/node_modules/nodemon
> node bin/postinstall || exit 0
Love nodemon? You can now support the project via the open collective:
> https://opencollective.com/nodemon/donate
> lzma-native@3.0.8 install /tmp/build_96ae59ea_/node_modules/lzma-native
> node-pre-gyp install --fallback-to-build && node node_modules/rimraf/bin.js build
node-pre-gyp ERR! Tried to download(404): https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v3.0.8-node-v83-linux-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for lzma-native@3.0.8 and node@14.15.4 (node-v83 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Tried to download(undefined): https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v3.0.8-node-v83-linux-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for lzma-native@3.0.8 and node@14.15.4 (node-v83 ABI, glibc) (falling back to source compile with node-gyp)
gyp: Call to 'sh liblzma-config.sh "/tmp/build_96ae59ea_/node_modules/lzma-native/build" "/tmp/build_96ae59ea_/node_modules/lzma-native/deps/xz-5.2.3.tar.bz2"' returned exit status 77 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/tmp/build_96ae59ea_/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Linux 4.4.0-1083-aws
gyp ERR! command "/tmp/build_96ae59ea_/.heroku/node/bin/node" "/tmp/build_96ae59ea_/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/tmp/build_96ae59ea_/node_modules/lzma-native/binding-v3.0.8-node-v83-linux-x64/lzma_native.node" "--module_name=lzma_native" "--module_path=/tmp/build_96ae59ea_/node_modules/lzma-native/binding-v3.0.8-node-v83-linux-x64"
gyp ERR! cwd /tmp/build_96ae59ea_/node_modules/lzma-native
gyp ERR! node -v v14.15.4
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/tmp/build_96ae59ea_/.heroku/node/bin/node /tmp/build_96ae59ea_/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/tmp/build_96ae59ea_/node_modules/lzma-native/binding-v3.0.8-node-v83-linux-x64/lzma_native.node --module_name=lzma_native --module_path=/tmp/build_96ae59ea_/node_modules/lzma-native/binding-v3.0.8-node-v83-linux-x64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/tmp/build_96ae59ea_/node_modules/lzma-native/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1048:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
node-pre-gyp ERR! System Linux 4.4.0-1083-aws
node-pre-gyp ERR! command "/tmp/build_96ae59ea_/.heroku/node/bin/node" "/tmp/build_96ae59ea_/node_modules/lzma-native/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /tmp/build_96ae59ea_/node_modules/lzma-native
node-pre-gyp ERR! node -v v14.15.4
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute '/tmp/build_96ae59ea_/.heroku/node/bin/node /tmp/build_96ae59ea_/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/tmp/build_96ae59ea_/node_modules/lzma-native/binding-v3.0.8-node-v83-linux-x64/lzma_native.node --module_name=lzma_native --module_path=/tmp/build_96ae59ea_/node_modules/lzma-native/binding-v3.0.8-node-v83-linux-x64' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lzma-native@3.0.8 install: `node-pre-gyp install --fallback-to-build && node node_modules/rimraf/bin.js build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lzma-native@3.0.8 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.Ci6p9/_logs/2021-01-30T16_41_27_068Z-debug.log
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
发布于 2021-01-31 15:42:02
出现问题的原因是因为与依赖项ffmpeg-binaries
发生冲突,所以我基本上卸载了它。
npm uninstall ffmpeg-binaries
https://stackoverflow.com/questions/65970550
复制相似问题