gpt4 book ai didi

reactjs - 在 Ubuntu 18.04 上使用 yarn 安装软件包时出现问题

转载 作者:行者123 更新时间:2023-12-04 19:09:52 24 4
gpt4 key购买 nike

我有一个在我的计算机上创建的 React 网站。我想在我的服务器(Ubuntu 18.04)中添加它,但遇到了问题。当我启动 yarn install 命令时出现错误。

节点版本:v12.13.0
yarn 版本:v1.19.1

error /home/dev/my-react/newest-release/node_modules/ledgerco/node_modules/node-hid: Command failed.
Exit code: 1
Command: prebuild-install || node-gyp rebuild
Arguments:
Directory: /home/dev/my-react/newest-release/node_modules/ledgerco/node_modules/node-hid
Output:
prebuild-install WARN install No prebuilt binaries found (target=12.13.0 runtime=node arch=x64 platform=linux)
gyp info it worked if it ends with ok
gyp info using node-gyp@5.0.5
gyp info using node@12.13.0 | linux | x64
gyp info find Python using Python version 2.7.15 found at "/usr/bin/python"
gyp info spawn /usr/bin/python
gyp info spawn args [
gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/home/dev/my-react/newest-release/node_modules/ledgerco/node_modules/node-hid/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/root/.cache/node-gyp/12.13.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/12.13.0',
gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/12.13.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/home/dev/my-react/newest-release/node_modules/ledgerco/node_modules/node-hid',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
make: Entering directory '/home/dev/my-react/newest-release/node_modules/ledgerco/node_modules/node-hid/build'
CC(target) Release/obj.target/hidapi/hidapi/libusb/hid.o
hidapi.target.mk:111: recipe for target 'Release/obj.target/hidapi/hidapi/libusb/hid.o' failed
make: Leaving directory '/home/dev/my-react/newest-release/node_modules/ledgerco/node_modules/node-hid/build'
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
../hidapi/libusb/hid.c:47:10: fatal error: libusb.h: No such file or directory
#include <libusb.h>
^~~~~~~~~~
compilation terminated.
make: *** [Release/obj.target/hidapi/hidapi/libusb/hid.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:210:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.15.0-70-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/dev/my-react/newest-release/node_modules/ledgerco/node_modules/node-hid

最佳答案

根据您缺少libusb的错误,请安装它

sudo apt install libusb-1.0-0-dev

关于reactjs - 在 Ubuntu 18.04 上使用 yarn 安装软件包时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59071385/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com