当前位置:网站首页>pkg打包node工程
pkg打包node工程
2022-07-28 09:33:00 【篆香阁】
首先安装 pkg打包node工程(以管理员身份运行exe )
npm install -g pkg
开始打包
// Windows
pkg -t win package.json
// Linux
pkg -t l package.json
如果报错找不到 bin
就在 package.json 中添加
“bin”: “./bin/www”,
注意需要在 package.json 中配置 pkg 需要打包的静态文件目录
文件依赖项
"bin": "server.js",
"pkg": {
"assets": [
"public/**/*",
"views/**/*"
]
}

配置静态文件目录后在使用这些目录的时候就要注意路径的问题了
app.use(express.static(path.join(__dirname, "public")));
// app.use(express.static("public"))
边栏推荐
猜你喜欢

领域事件和集成事件没那么高大上

Have you ever seen this kind of dynamic programming -- the stock problem of state machine dynamic programming (Part 2)

C# 读写文件从用户态切到内核态,到底是个什么流程?

Software testing and quality learning notes 2 - black box testing

Some problems about CLR GC tuning
C form application uses object binding DataGridView data binding

C# 倒计时工具

时序分析41 - 时序预测 TBATS模型
![ASP.NET Core 6框架揭秘实例演示[29]:搭建文件服务器](/img/90/40869d7c03f09010beb989af07e2f0.png)
ASP.NET Core 6框架揭秘实例演示[29]:搭建文件服务器

SD卡介绍(基于SPEC3.0)
随机推荐
Espresso systems, which has just obtained financing, has both intellectual property rights and team ethics in trouble
实验四 使用fdisk对硬盘进行管理
哪些字符串会被FastJson解析为null呢?
C# 读写文件从用户态切到内核态,到底是个什么流程?
Scalable search bar, imitating Huawei application market
关于CLR GC调优的一些问题
Software testing and quality learning notes 2 - black box testing
数据库高级学习笔记--对象类型
PHP Basics
ASP.NET Core 6框架揭秘实例演示[29]:搭建文件服务器
Common tool functions are constantly updated
数据库高级学习笔记--存储结构
TCP 基础知识
How to learn so many conceptual things in database? Seeking method
PlatoFarm几大创新经济模型,给予当下元宇宙市场的启发
初学C#必须要掌握的基础例题
分支与循环(1)
Experiment 4 uses fdisk to manage hard disk
TimeBasedRollingPolicy简介说明
FixedWindowRollingPolicy简介说明