【问题标题】:Unable to install webtorrent-hybrid - node-pre-gyp: command not found无法安装 webtorrent-hybrid - node-pre-gyp:找不到命令
【发布时间】:2021-06-23 13:00:37
【问题描述】:

我正在尝试安装 webtorrent-hybrid 来构建电子 p2p 应用程序。我正在使用 vue ui,因为该应用程序将使用 vue 来管理前端内容,并且我已经成功创建了一个使用 vue-cli-plugin-electron-builder rc-6、Vue 3 和 node v15.4.0 的新项目。 vue cli插件安装的Electron版本是11.0。无论如何,当我尝试安装 webtorrent-hybrid 时,我总是在终端中收到此错误

npm ERR! code 1
npm ERR! path /Users/dev/Sites/wtorrent-electron/node_modules/wrtc
npm ERR! command failed
npm ERR! command sh -c node scripts/download-prebuilt.js
npm ERR! /bin/sh: node-pre-gyp: command not found

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/dev/.npm/_logs/2021-03-26T16_40_51_717Z-debug.log
command failed: npm install --loglevel error webtorrent-hybrid --legacy-peer-deps

有没有办法修复它以便我可以安装库?如果无法解决问题,是否可以在电子应用程序中使用 webtorrent?

【问题讨论】:

    标签: node.js vue.js npm electron


    【解决方案1】:

    试试 Node 14(当前的 lts),它有更好的预构建,如果没有,使用命令 npm install --unsafe-perm=true 应该可以解决问题。

    【讨论】:

    • 需要测试第二个选项,我不想只为单个库降级;)
    猜你喜欢
    • 1970-01-01
    • 2020-04-27
    • 2015-12-07
    • 1970-01-01
    • 2019-07-01
    • 1970-01-01
    • 2020-05-18
    • 2018-05-19
    • 2018-08-05
    相关资源
    最近更新 更多