The nativefier command generates a desktop application

Nativefier can quickly generate executable files (.app,.exe, etc.) for use in Windows, MacOS, and Linux.

The installation

The node.js version should be >= 10

npm install nativefier -g

Copy the code

use

Pack a Baidu desktop app

nativefier "https://www.baidu.com/"
Copy the code

Then it will generate app-Win32-x64 folder in the execution command directory, enter and then open app.exe, a Desktop version of Baidu is packaged, can be packaged any website.

Matters needing attention

Because this is based on the Electron package, the execution of the name to download the Electron sometimes the download will fail and the package will fail. Solution Set the domestic source

npm set ELECTRON_MIRROR="https://npm.taobao.org/mirrors/electron/"
Copy the code

reference

Github.com/jiahaog/nat…

My blog and GitHub address

github.com/lanpangzhi

blog.langpz.com