Pake
Pake copied to clipboard
Ubuntu 打包错误,无法找到文件以及重复提示安装rust
Ubuntu 版本为 Ubuntu 22.04.1 LTS,amd64
本机已安装最新rust和node,但是执行时依旧提示需要安装rust
接下来日志为:
✔ Downloading Rust
✔ please input your application name … blog
up to date, audited 235 packages in 557ms
76 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
> [email protected] build
> npm run tauri build --release
> [email protected] tauri
> tauri build
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/interface/rust.rs:762:69
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
[Error: ENOENT: no such file or directory, copyfile '/usr/local/lib/node_modules/pake-cli/src-tauri/target/release/bundle/deb/blog_1.0.0_amd64.deb' -> '/home/ubuntu/blog.deb'] {
errno: -2,
code: 'ENOENT',
syscall: 'copyfile',
path: "/usr/local/lib/node_modules/pake-cli/src-tauri/target/release/bundle/deb/blog_1.0.0_amd64.deb",
dest: "/home/ubuntu/blog.deb"
}
Node.js v18.12.1`
显示的是文件没有找到,请查看/usr/local/lib/node_modules/pake-cli/src-tauri/target/release/bundle/deb/blog_1.0.0_amd64.deb
是否存在。
显示的是文件没有找到,请查看
/usr/local/lib/node_modules/pake-cli/src-tauri/target/release/bundle/deb/blog_1.0.0_amd64.deb
是否存在。
target文件夹都没有。。编译也没提示错误啊
目测是是应用图标没找到,所以报错了。
解决办法:1.手动提供一个图标,利用--icon
传入。
或者利用github源码最新开发版,理论上应该有提供默认图标。
sudo npm uninstall -g pake-cli
sudo npm install -g https://github.com/tw93/Pake.git
试过了。。还是一样的错误,应该不是图标问题,我手动指定了一个png文件
sudo pake wordpress.com --transparent --icon '/home/ubuntu/1.png'
试过了。。还是一样的错误,应该不是图标问题,我手动指定了一个png文件
sudo pake wordpress.com --transparent --icon '/home/ubuntu/1.png'
--transparent 这个参数去除试试 还不行把sudo pake换成普通权限(详见如何把npm安装到普通用户下https://gist.github.com/Giancarlos/d087f8a9e6516716da98ad0c0f5a8f58)
同样的错误信息,无法成功打包
同样遇到了这个问题
同样遇到了这个问题
有安装tauri需要的基本依赖吗?
各位打包失败的,自检一下是否安装Ubuntu/Debian/Arch等系统所需要的依赖。目前脚本并没有内置自动识别你系统,自动帮你安装依赖的功能。
打包的时候第一行就有提示的了。 $ sudo pake wordpress.com --transparent To build the Linux app, you need to install Rust and Linux package See more in https://tauri.app/v1/guides/getting-started/prerequisites#installing 我刚随便找了一个wsl2封装的ubuntu 20.04,打包没有任何问题。
各位打包失败的,自检一下是否安装Ubuntu/Debian/Arch等系统所需要的依赖。目前脚本并没有内置自动识别你系统,自动帮你安装依赖的功能。
打包的时候第一行就有提示的了。 $ sudo pake wordpress.com --transparent To build the Linux app, you need to install Rust and Linux package See more in https://tauri.app/v1/guides/getting-started/prerequisites#installing 我刚随便找了一个wsl2封装的ubuntu 20.04,打包没有任何问题。
按照提示装了依赖以后有新的报错:
Compiling app v0.1.0 (/usr/local/lib/node_modules/pake-cli/src-tauri)
Finished release [optimized] target(s) in 14.69s
Bundling weekly_1.0.0_amd64.deb (/usr/local/lib/node_modules/pake-cli/src-tauri/target/release/bundle/deb/weekly_1.0.0_amd64.deb)
Bundling weekly_1.0.0_amd64.AppImage (/usr/local/lib/node_modules/pake-cli/src-tauri/target/release/bundle/appimage/weekly_1.0.0_amd64.AppImage)
Error failed to bundle project: error running appimage.sh: error running appimage.sh: failed to run /usr/local/lib/node_modules/pake-cli/src-tauri/target/release/bundle/appimage/build_appim age.sh
file:///usr/local/lib/node_modules/pake-cli/dist/cli.js:1793
reject(new Error(${code}
));
^
Error: 1 at file:///usr/local/lib/node_modules/pake-cli/dist/cli.js:1793:24 at /usr/local/lib/node_modules/pake-cli/node_modules/shelljs/src/exec.js:145:9 at ChildProcess.exithandler (node:child_process:427:5) at ChildProcess.emit (node:events:513:28) at maybeClose (node:internal/child_process:1098:16) at ChildProcess._handle.onexit (node:internal/child_process:304:5)
Node.js v19.2.0
error running appimage.sh: error running appimage.sh
两个解决办法:
- 参考该链接修复:https://github.com/tauri-apps/tauri/issues/3278
- cd /usr/local/lib/node_modules/pake-cli/,找到src-tauri/tauri.linux.conf.json,删除里面的appimage字段,这样只打包deb就行了。修改后
"targets": ["deb"]
,然后重新运行打包。
error running appimage.sh: error running appimage.sh
两个解决办法:
- 参考该链接修复:[bug] tauri build fails with "error running appimage.sh" tauri-apps/tauri#3278
- cd /usr/local/lib/node_modules/pake-cli/,找到src-tauri/tauri.linux.conf.json,删除里面的appimage字段,这样只打包deb就行了。修改后
"targets": ["deb"]
,然后重新运行打包。
macOS呢
error running appimage.sh: error running appimage.sh
两个解决办法:
- 参考该链接修复:[bug] tauri build fails with "error running appimage.sh" tauri-apps/tauri#3278
- cd /usr/local/lib/node_modules/pake-cli/,找到src-tauri/tauri.linux.conf.json,删除里面的appimage字段,这样只打包deb就行了。修改后
"targets": ["deb"]
,然后重新运行打包。
试过了,只保留了deb还是同样错误。。😂
thread 'Result::unwrap()
on an Err
value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/interface/rust.rs:762:69
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
node:internal/process/promises:289
triggerUncaughtException(err, true /* fromPromise */);
^
[Error: ENOENT: no such file or directory, copyfile '/opt/homebrew/lib/node_modules/pake-cli/src-tauri/target/release/bundle/dmg/Mx_Login_1.0.0_aarch64.dmg' ->
我这边解决了,单独安装rust即可。 mac m1
我这边解决了,单独安装rust即可。 mac m1 个人猜测: pake-cli自动安装的rust用的官方bash脚本,安装位置是普通权限。 而打包的时候,大部分人省事用了sudo权限,而sudo默认不会读取当前普通用户的rust,所以就识别不到。 而当你手动安装rust的时候,像ubuntu,利用apt安装rust,安装是系统位置,所有人都能用,这个时候就没有问题了。 总结:pake-cli或许不应该帮用户安装rust,提醒用户未安装rust,然后让他自行安装rust可能更好。