问题描述
我正在尝试安装webtorrent-hybrid来构建电子p2p应用程序.我正在使用vue ui,因为该应用程序将使用vue管理前端内容,并且我已经成功创建了一个新项目,该项目使用vue-cli-plugin-electron-builder rc-6,Vue 3和节点v15.4.0.vue cli插件安装的Electron版本是11.0.无论如何,当我尝试安装webtorrent-hybrid时,总是在终端中出现此错误
I'm trying to install webtorrent-hybrid to build an electron p2p app. I'm using vue ui because the app will use vue to manage front-end stuff and I've successfully created a new project that use vue-cli-plugin-electron-builder rc-6, Vue 3 and node v15.4.0. The Electron version installed by the vue cli plugin is 11.0. Anyway When I try to install webtorrent-hybrid I always get this error in terminal
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?
Is there a way to fix it so I can install the library? If isn't possible to solve the problem, is there any alternative to use webtorrent inside an electron app?
推荐答案
尝试使用预编译效果更好的Node 14(当前lts),如果没有,则使用命令 npm install --unsafe-perm = true
>应该可以解决问题.
Try Node 14 (current lts) which has better prebuilts and if not, using the command npm install --unsafe-perm=true
should do the trick.
这篇关于无法安装Webtorrent混合-node-pre-gyp:命令未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!