首页 > 基础资料 博客日记

Windows端安装perry.ts

2026-05-20 21:00:04基础资料围观14

本篇文章分享Windows端安装perry.ts,对你有帮助的话记得收藏一下,看极客资料网收获更多编程知识

2026年5月20日

看大家宣传的还不错, 装起来试试看

1. 官网 Perry — TypeScript → Native

2. 管理员打开终端(win11, 右键开始按钮, 选择终端管理员

3. 执行安装命令

winget install PerryTS.Perry

4. 安装过程中, 会一起安装 LLVM, xwin, 你也可以通过其他网站下载后安装,

然后重新执行上边的命令, 如果已经检测到安装过了, 会跳过的,

所以安装时记得允许把可执行文件添加到环境变量中

虽然是从github安装, 但是没有FQ也可以下载安装, 软件很大, 记得要有管理员权限

如果下载成功安装失败, 可以查一下winget命令下载的软件在哪里, 然后找到双击安装

Windows Toolchain Setup

  This downloads the Microsoft CRT + Windows SDK libraries (via xwin)
  so Perry can link Windows executables without Visual Studio Build Tools.

  ✓ LLVM found: clang
  ✓ xwin found: C:\Users\95486\AppData\Local\Microsoft\WinGet\Packages\PerryTS.Perry_Microsoft.Winget.Source_8wekyb3d8bbwe\xwin.exe

5. 这俩软件安装完毕后执行初始化命令

perry setup windows

这一步同样会检查之前的两个软件是否已经正常安装, 然后安装一些sdk类的东西

⚠ Microsoft Visual Studio Build Tools License

  The Microsoft CRT + Windows SDK libraries are redistributable under
  the Microsoft Software License Terms. By proceeding you accept:

    https://go.microsoft.com/fwlink/?LinkId=2086102

  Do you accept the license? yes

  Output: C:\Users\95486\AppData\Local\perry\windows-sdk
  Expect ~700 MB download / ~1.5 GB unpacked. Takes 24 minutes on a
  typical connection. Partial downloads are resumable — safe to re-run.

  CRT.headers [0s] █████████████████████████████████████████████████████████████████████ 14.13 MiB/14.13 MiB 📦 splatted
  CRT.libs.x86_64.desktop [0s] ███████████████████████████████████████████████████████ 204.95 MiB/204.95 MiB 📦 splatted
  CRT.libs.x86_64.store [0s] ███████████████████████████████████████████████████████████ 89.74 MiB/89.74 MiB 📦 splatted
  SDK.headers.all.none [1s] ████████████████████████████████████████████████████████████ 84.53 MiB/84.53 MiB 📦 splatted
  SDK.headers.all.none [0s] ██████████████████████████████████████████████████████████████ 6.21 MiB/6.21 MiB 📦 splatted
  SDK.headers.all.store [2s] █████████████████████████████████████████████████████████ 247.40 MiB/247.40 MiB 📦 splatted
  SDK.headers.all.store [0s] █████████████████████████████████████████████████████████████ 5.24 MiB/5.24 MiB 📦 splatted
  SDK.headers.x86_64.none [0s] ███████████████████████████████████████████████████████ 163.65 KiB/163.65 KiB 📦 splatted
  SDK.libs.x86_64 [0s] █████████████████████████████████████████████████████████████████ 67.02 MiB/67.02 MiB 📦 splatted
  SDK.libs.store.all [0s] ██████████████████████████████████████████████████████████████ 38.05 MiB/38.05 MiB 📦 splatted
  SDK.ucrt.all [0s] ██████████████████████████████████████████████████████████████████ 121.88 MiB/121.88 MiB 📦 splatted
  ✓ Windows SDK ready at C:\Users\95486\AppData\Local\perry\windows-sdk
    (45.4s)

  Try it:  perry compile hello.ts && ./hello.exe

6. 以上安装结束后就可以试试了, 命令行进入到代码目录, 执行编译链接命令

测试代码文档: Introduction - Perry Documentation

PS D:\code\perryproject> perry compile hello.ts -o hello.exe
Collecting modules...
Found 1 module(s): 1 native, 0 JavaScript
Generating code...
Wrote object file: hello_ts.o
Linking (runtime-only)...
Wrote executable: hello.exe
Binary size: 1.2MB

 

7. 编译后代码目录文件

局部截取_20260520_200933

 8. 命令行启动程序(没有界面, 所以是命令行直接输出)

PS D:\code\perryproject> ./hello.exe
Hello, Perry!

9. 搞个界面的

局部截取_20260520_201603

 


文章来源:https://www.cnblogs.com/iLoveMyD/p/20098840
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:jacktools123@163.com进行投诉反馈,一经查实,立即删除!

标签:

相关文章

本站推荐

标签云