将线上网站打包成exe可执行文件

Nativefier——可以把网页打包成exe的工具

1、首先电脑需要有node环境。

去nodejs的官网https://nodejs.org下载,一直下一步就行
检验安装是否成功,cmd命令输入如下命令,出现nodejs的版本号,说明安装成功

npm -v

2、安装nativefier

npm install nativefier -g

要在cmd里面执行,不能是Powershell里面,会报错

3、打包网站,在 nativefier 后加上需要转换的网站地址, 比如:

nativefier "https://www.zhihu.com/"

国内网络环境可能会很慢或者直接失败,建议挂全局梯子后操作

还有一些另外的细节:

自定义图标和名字

名字可以生成完以后直接F2重命名, 如果想XX以下就直接创建时加上 --name 参数, 图标同理, 可以一起用:

nativefier --name "app名字" --icon "app图标路径" "https://www.zhihu.com"  // 自定义名字 // 自定义图标 图标路径可以是本地文件的路径

生成后的文件夹在你打开cmd执行生成命令的当前目录

可以再配合winrar将文件夹创建成一个自解压的exe文件
sanradar
sanradar
文章: 104

28 评论

  1. Very informative article! I appreciate the depth of analysis. If you want to delve deeper, here’s a helpful resource: EXPLORE FURTHER. Eager to hear everyone’s thoughts!

  2. Hiya, I am really glad I’ve found this info. Nowadays bloggers publish just about gossips and internet and this is really irritating. A good web site with exciting content, this is what I need. Thanks for keeping this web-site, I’ll be visiting it. Do you do newsletters? Cant find it.

  3. I seriously love your website.. Very nice colors & theme. Did you create this website yourself? Please reply back as I’m wanting to create my own website and would like to know where you got this from or what the theme is named. Thanks.

  4. An interesting discussion is definitely worth comment. I think that you need to publish more on this subject matter, it might not be a taboo subject but generally people do not talk about these issues. To the next! Kind regards.

留下评论

您的电子邮箱地址不会被公开。 必填项已用 * 标注