代理設(shè)置全局也不行,后面發(fā)現(xiàn)給rust cargo設(shè)置代理即可
如果出現(xiàn)跟我一樣的情況,可以試下,我改完之后就可以了
D:\xxxxx\xxxx>pnpm tauri build
> xxxx@0.0.0 tauri
> tauri "build"
Running beforeBuildCommand `pnpm build`
> xxxxx@0.0.0 build
> vite build
vite v5.1.6 building for production...
? 17 modules transformed.
dist/index.html 0.48 kB │ gzip: 0.31 kB
dist/assets/index-Tn0Wq8gz.css 1.40 kB │ gzip: 0.66 kB
dist/assets/index-BP7kSTzz.js 57.74 kB │ gzip: 23.26 kB
? built in 627ms
Updating crates.io index
warning: spurious network error (3 tries remaining): [5] Couldn't resolve proxy name (Unsupported proxy syntax in ''http://127.0.0.1:7890'': Port number was not a decimal number between 0 and 65535)
warning: spurious network error (2 tries remaining): [5] Couldn't resolve proxy name (Unsupported proxy syntax in ''http://127.0.0.1:7890'': Port number was not a decimal number between 0 and 65535)
warning: spurious network error (1 tries remaining): [5] Couldn't resolve proxy name (Unsupported proxy syntax in ''http://127.0.0.1:7890'': Port number was not a decimal number between 0 and 65535)
error: failed to get `serde` as a dependency of package `haolin v0.0.0 (D:\Project\haolingjiancai\haolin\src-tauri)`
Caused by:
failed to query replaced source registry `crates-io`
Caused by:
download of config.json failed
Caused by:
failed to download from `https://index.crates.io/config.json`
Caused by:cargo update
[5] Couldn't resolve proxy name (Unsupported proxy syntax in ''http://127.0.0.1:7890'': Port number was not a decimal number between 0 and 65535)
Error failed to build app: failed to build app
?ELIFECYCLE? Command failed with exit code 1.
如果出現(xiàn)該錯(cuò)誤,cd進(jìn)入項(xiàng)目的src-tauri文件夾,運(yùn)行cargo update
Updating crates.io index
warning: spurious network error (3 tries remaining): [5] Couldn't resolve proxy name (Unsupported proxy syntax in ''http://127.0.0.1:7890'': Port number was not a decimal number between 0 and 65535)
warning: spurious network error (2 tries remaining): [5] Couldn't resolve proxy name (Unsupported proxy syntax in ''http://127.0.0.1:7890'': Port number was not a decimal number between 0 and 65535)
warning: spurious network error (1 tries remaining): [5] Couldn't resolve proxy name (Unsupported proxy syntax in ''http://127.0.0.1:7890'': Port number was not a decimal number between 0 and 65535)
error: failed to get `serde` as a dependency of package `haolin v0.0.0 (D:\Project\haolingjiancai\haolin\src-tauri)`
會(huì)發(fā)現(xiàn)出現(xiàn)同樣的錯(cuò)誤
這時(shí)候只要在 C:\Users\用戶名.cargo 下創(chuàng)建 config 文件(可以先創(chuàng)建config.txt文件,填充內(nèi)容后刪除后綴)
內(nèi)容設(shè)置
[http]
proxy = "127.0.0.1:7890"
[https]
proxy = "127.0.0.1:7890"
現(xiàn)在重新運(yùn)行會(huì)發(fā)現(xiàn)就正常了
第一次用tauri,發(fā)現(xiàn)好多錯(cuò)誤Google都找不到....