声明:本软件来自笑来老师的分享,连接为:https://github.com/xiaolai/tobiplayer,详细说明请进链接内Readme说明。
本文是针对windows版本的安装,步骤如下:
1. 安装去github 下载最新的 nvm 找到 nvm-setup.zip 点击下载。
2. 找到nvm安装路径 -> 找到 settings.txt 文件 -> 配置下载源,增加两行:
node_mirror: https://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/
3. 用nvm看node版本:
nvm list available
4. 安装node:
nvm install 20.5.1
nvm use 20.5.1
5. 本地先安装好python3,然后安装stable-ts库:
pip install -U stable-ts
6.下载github至本地:
git clone https://github.com/xiaolai/tobiplayer.git
注意:
git clone的问题:
修改hosts文件(C:\Windows\System32\drivers\etc),增加:
192.30.255.112 github.com git
185.31.16.184 github.global.ssl.fastly.net
如有特殊上网,设置与系统代理一样(注意端口也一样):
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy http://127.0.0.1:7890
都设置完了可以运行如下(保险,也可不运行)
ipconfig /flushdns
再运行ping github.com就可以了。
7. node编译:
cd tobiplayer
npm install(可用cnpm代替)
npm run dev(可用cnpm代替)
注意:
1).npm install如出现问题,需要清除缓存,cmd需要以管理员运行,命令:
npm cache clean --force
或
C:\Users\自己用户的文件夹\ 下找到 .npmrc 文件并删除
2).由于网络问题,一般可用cnpm代替npm,
npm install -g cnpm --registry=https://registry.npm.taobao.org
这个命令会全局安装 cnpm,并设置其使用淘宝的 npm 镜像源。
3).全局安装vue,在此 CMD 输入 npm install -g @vue/cli 就可以成功安装了
8. 打包为本地:
npm run build:win(可用cnpm代替)
注意:
1). 运行的时候用于cnpm命令,并且将WaveSurferJS.vue(.\src\renderer\components下)将
import RegionsPlugin from 'wavesurfer.js/dist/plugins/regions.esm.js'
替换为
import RegionsPlugin from '../../../node_modules/.store/wavesurfer.js@7.6.5/node_modules/wavesurfer.js/dist/plugins/regions.esm.js';
2). 可能由于网络问题,可能直接打包连接github资源出问题,可以修改electron-builder.json最后增加如下:
......
"!dist"
],
"electronDownload": {
"mirror": "https://npm.taobao.org/mirrors/electron/"
}
}
3).网格问题,在以下页面中
https://github.com/electron-userland/electron-builder-binaries/releases
需要单独下载winCodeSign-2.6.0.7z,解压后连文件夹(带版本号)拷贝至:
C:\Users\hp\AppData\Local\electron-builder\Cache\winCodeSign
4).同3),在以上网页中单独下载nsis-3.0.4.1.zip(注意是source code),解压后,把两个文件夹重命名:(nsis -> nsis-3.0.4.1 ) (nsis-resources -> nsis-resources-3.4.1),将这两个文件夹拷贝至:
C:\Users\hp\AppData\Local\electron-builder\Cache\nsis
运行图如下:

网友评论