当前位置:网站首页>PKG packaging node project
PKG packaging node project
2022-07-28 11:22:00 【Zhuanxiangge】
First installation pkg pack node engineering ( Run as administrator exe )
npm install -g pkg
Start packing
// Windows
pkg -t win package.json
// Linux
pkg -t l package.json
If an error is reported and cannot be found bin
It's just package.json Add
“bin”: “./bin/www”,
Note the need for package.json Middle configuration pkg Static file directory to package
File Dependencies
"bin": "server.js",
"pkg": {
"assets": [
"public/**/*",
"views/**/*"
]
}

After configuring static file directories, you should pay attention to the path problem when using these directories
app.use(express.static(path.join(__dirname, "public")));
// app.use(express.static("public"))
边栏推荐
- Use the statement object to execute DDL statements to create tables
- 「Node学习笔记」Koa框架学习
- Relevant knowledge points of hash table
- 【MySQL从入门到精通】【高级篇】(九)InnoDB的B+树索引的注意事项
- Zero code | easily realize data warehouse modeling and build Bi Kanban
- 低代码(aPaas)为什么最近又火了?
- Bc35 NB module at instruction development summary
- [MySQL from introduction to proficiency] [advanced chapter] (IX) precautions for InnoDB's b+ tree index
- Make a virtual human with zego avatar | virtual anchor live broadcast solution
- CGAL compilation error
猜你喜欢

What's the secret of creating a popular short video?

21. Merge two ordered linked lists

盘点:6本书教会你职场晋升必备技能
Microsoft security team found an Austrian company that used windows Zero Day vulnerability to sell spyware

Preliminary understanding of float

低代码十问:一文讲透关于低代码的一切!

Learn to use MySQL explain to execute the plan, and SQL performance tuning is no longer difficult

Sword finger offer 30. stack containing min function

outlook突然变得很慢很卡怎么解决

Crm+ zero code: easily realize enterprise informatization
随机推荐
[JS advanced] JS functions, overloads, anonymous functions, scopes and scope chains_ 03
Eslint, Eslint中文文档
Relevant knowledge points of hash table
Nodejs: mongodb simple fuzzy + paging query instance
Why should coding and modulation be carried out before transmission
Do you want to enroll in class for advanced soft exam
echo -ne(echo line)
Picture slide effect
cortex-M4与cortex-A7内核启动流程分析
Jianzhi offer 09. realize queue with two stacks
Nodejs: set up the express service, set up the session and realize the exit operation
DHCP experiment demonstration (Huawei switch device configuration)
低代码(aPaas)为什么最近又火了?
Table data processing software, what else besides excel?
表格数据处理软件,除了Excel还有什么?
Nodejs: return value of mongodb after successful insertion
Generation and use of Lib library files in keil and IAR
Under the platform driven platform, the "dev- > dev.of_node" of the formal parameter dev in the probe function Understanding of
Cortex-M内核管理全局中断的三种方式
EC20/EC25 4G模块AT指令开发总结