我在Node.js中遇到SQLite的问题当我使用nodemon进行开发时,一切都还可以,但是当我用pm2 ram开始我的应用时,ram变得越来越大+我有一个错误“错误:SQLITE_CANTOPEN:无法打开数据库文件“。 我的数据库声明:
const dbPromise = sqlite.open(path.join(__dirname, "../../db/app.db"), { Promise });
我的pm2配置:
{
"apps": [{
"name": "Main Server",
"script": "E:/Projekty/mainserver/0.3.7/bin/www",
"error_file": "E:/Projekty/mainserver/0.3.7/logs/errors.log",
"out_file": "E:/Projekty/mainserver/0.3.7/logs/output.log",
"merge_logs": true,
"log_date_format": "YYYY-MM-DD HH:mm Z",
"max_size": "3M",
"retain": "all",
"compress": true,
"rotateInterval": "0 0 0 * * *",
"instances": 1,
"watch": true,
"ignore_watch" : ["E:/Projekty/mainserver/0.3.7/node_modules",
"E:/Projekty/mainserver/0.3.7/logs", "E:/Projekty/mainserver/0.3.7/db"],
"env": {
"NODE_ENV": "development",
"ROOT_PATH": "E:/Projekty/mainserver/0.3.7"
}
}]
}