Pake icon indicating copy to clipboard operation
Pake copied to clipboard

Ubuntu 打包错误,无法找到文件以及重复提示安装rust

Open zhucaidan opened this issue 2 years ago • 13 comments

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`

zhucaidan avatar Dec 12 '22 13:12 zhucaidan

显示的是文件没有找到,请查看/usr/local/lib/node_modules/pake-cli/src-tauri/target/release/bundle/deb/blog_1.0.0_amd64.deb是否存在。

neutrous avatar Dec 12 '22 16:12 neutrous

显示的是文件没有找到,请查看/usr/local/lib/node_modules/pake-cli/src-tauri/target/release/bundle/deb/blog_1.0.0_amd64.deb是否存在。

image

target文件夹都没有。。编译也没提示错误啊

zhucaidan avatar Dec 12 '22 16:12 zhucaidan

目测是是应用图标没找到,所以报错了。 解决办法:1.手动提供一个图标,利用--icon传入。 或者利用github源码最新开发版,理论上应该有提供默认图标。

sudo npm uninstall -g pake-cli
sudo npm install -g https://github.com/tw93/Pake.git

Tlntin avatar Dec 12 '22 23:12 Tlntin

试过了。。还是一样的错误,应该不是图标问题,我手动指定了一个png文件

sudo pake wordpress.com --transparent --icon '/home/ubuntu/1.png'

zhucaidan avatar Dec 13 '22 01:12 zhucaidan

试过了。。还是一样的错误,应该不是图标问题,我手动指定了一个png文件

sudo pake wordpress.com --transparent --icon '/home/ubuntu/1.png'

--transparent 这个参数去除试试 还不行把sudo pake换成普通权限(详见如何把npm安装到普通用户下https://gist.github.com/Giancarlos/d087f8a9e6516716da98ad0c0f5a8f58)

Tlntin avatar Dec 13 '22 01:12 Tlntin

同样的错误信息,无法成功打包

midpoint avatar Dec 13 '22 09:12 midpoint

同样遇到了这个问题

JabinSun avatar Dec 13 '22 09:12 JabinSun

同样遇到了这个问题

有安装tauri需要的基本依赖吗?

Tlntin avatar Dec 13 '22 09:12 Tlntin

各位打包失败的,自检一下是否安装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,打包没有任何问题。

Tlntin avatar Dec 13 '22 09:12 Tlntin

各位打包失败的,自检一下是否安装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

JabinSun avatar Dec 13 '22 10:12 JabinSun

error running appimage.sh: error running appimage.sh

两个解决办法:

  1. 参考该链接修复:https://github.com/tauri-apps/tauri/issues/3278
  2. cd /usr/local/lib/node_modules/pake-cli/,找到src-tauri/tauri.linux.conf.json,删除里面的appimage字段,这样只打包deb就行了。修改后 "targets": ["deb"],然后重新运行打包。

Tlntin avatar Dec 13 '22 10:12 Tlntin

error running appimage.sh: error running appimage.sh

两个解决办法:

  1. 参考该链接修复:[bug] tauri build fails with "error running appimage.sh" tauri-apps/tauri#3278
  2. cd /usr/local/lib/node_modules/pake-cli/,找到src-tauri/tauri.linux.conf.json,删除里面的appimage字段,这样只打包deb就行了。修改后 "targets": ["deb"],然后重新运行打包。

macOS呢

zzy619 avatar Dec 13 '22 10:12 zzy619

error running appimage.sh: error running appimage.sh

两个解决办法:

  1. 参考该链接修复:[bug] tauri build fails with "error running appimage.sh" tauri-apps/tauri#3278
  2. cd /usr/local/lib/node_modules/pake-cli/,找到src-tauri/tauri.linux.conf.json,删除里面的appimage字段,这样只打包deb就行了。修改后 "targets": ["deb"],然后重新运行打包。

试过了,只保留了deb还是同样错误。。😂

zhucaidan avatar Dec 13 '22 11:12 zhucaidan

thread '' 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: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' ->

josangmi avatar Dec 14 '22 06:12 josangmi

我这边解决了,单独安装rust即可。 mac m1

josangmi avatar Dec 14 '22 07:12 josangmi

我这边解决了,单独安装rust即可。 mac m1 个人猜测: pake-cli自动安装的rust用的官方bash脚本,安装位置是普通权限。 而打包的时候,大部分人省事用了sudo权限,而sudo默认不会读取当前普通用户的rust,所以就识别不到。 而当你手动安装rust的时候,像ubuntu,利用apt安装rust,安装是系统位置,所有人都能用,这个时候就没有问题了。 总结:pake-cli或许不应该帮用户安装rust,提醒用户未安装rust,然后让他自行安装rust可能更好。

Tlntin avatar Dec 14 '22 07:12 Tlntin