当前位置:网站首页>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"))
边栏推荐
猜你喜欢

Machine learning (10) -- hypothesis testing and regression analysis

老板:公司系统太多,能不能实现账号互通?

Can multithreading optimize program performance?

SeekTiger生态通证STI 新进展,4月14日登录 ZB

Use xposed to crack the software

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

关于CLR GC调优的一些问题

路由器固件解密思路

业务可视化-让你的流程图'Run'起来(4.实际业务场景测试)

My vivado practice - single cycle CPU instruction analysis
随机推荐
手机号,固话正则表达式
Take you to wechat applet development in 3 minutes
Window source code analysis (II): the adding mechanism of window
Have you ever seen this kind of dynamic programming -- the stock problem of state machine dynamic programming (Part 2)
[summary of leetcode weekly competition] the 83rd fortnight competition of leetcode (7.23)
Time series analysis 41 - time series prediction tbats model
时序分析41 - 时序预测 TBATS模型
Create SSL certificate using OpenSSL
NET 3行代码实现文字转语音功能
Method parameter transfer mechanism of C #
478-82(56、128、718、129)
IDC script file running
Can multithreading optimize program performance?
Retrofit源码解析
j s的数组方法,循环
Analysis of the internal principle of LinkedList
go语言切片Slice和数组Array对比panic runtime error index out of range问题解决
Seeing clearly is more important than walking fast, because you can go far only when you walk right
Arouter source code analysis (I)
PHP 获取接口的方式