Egg Error

作者: JunChow520 | 来源:发表于2020-05-27 13:27 被阅读0次

关键词:热更 自动重启 实时生效


更新失效

若使用WebStorm等JetBrain系列的IDE,则需在【设置】>【系统设置】中关闭“Use "safe write"”选项。

使用WebStorm IDE打开文件显示“ESLint: TypeError: this.cliEngine is not a constructor”


Egg.js 本地开始时,如何在修改代码后自动刷新浏览器,应用自动重启实时生效呢?


Egg.js 使用PM2进程管理工具

$ vim index.js
require('egg').startCluster({
  baseDir: __dirname,
  port: process.env.PORT || 7001,
  workers: 2,
  https: false, // nginx https
});

命令行启动

$ EGG_SERVER_ENV=prod pm2 start index.js --name project_name

npm run dev启动时出现错误

WARN 3960576 [egg:loader] pkg.eggPlugin is missing in D:\gitee\api\node_modules\egg-bin\package.json

npm run dev启动本地应用出现错误

WARN 4189256 [egg-watcher] defaultEventSource watcher will NOT take effect

$ npm i

出现错误信息

Error: EACCES: permission denied, open '/home/www/api/.travis.yml'

需在sudo命令后添加--unsafe-perm参数

$ sudo npm i --unsafe-perm

相关文章

网友评论

      本文标题:Egg Error

      本文链接:https://www.haomeiwen.com/subject/sdecahtx.html