Warning: Accessing non-existent property ‘padLevels‘ of module exports inside circular dependency

使用forever start 来进行node 进程守护,程序异常解决办法

错误如下图所示

> express@0.0.0 start D:\app\express
> forever start ./forever/config.json

warn:    --minUptime not set. Defaulting to: 1000ms
warn:    --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
info:    Forever processing file: /bin/www
(node:13672) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:13672) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
error:   Cannot start forever
error:   log file C:\Users\syy\.forever\sunnyApp.log exists. Use the -a or --append option to append log.
npm ERR! code ELIFECYCLE
npm ERR! errno 4294967295
npm ERR! express@0.0.0 start: `forever start ./forever/config.json`
npm ERR! Exit status 4294967295
npm ERR!
npm ERR! Failed at the express@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\syy\AppData\Roaming\npm-cache\_logs\2020-11-02T02_29_40_397Z-debug.log
终端进程“C:\WINDOWS\System32\cmd.exe /d /c npm run start”已终止,退出代码: 4294967295。
D:\app\express>node --trace-warnings ...
internal/modules/cjs/loader.js:1032
  throw err;
  ^

Error: Cannot find module 'D:\app\express\...'
?[90m    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1029:15)?[39m
?[90m    at Function.Module._load (internal/modules/cjs/loader.js:898:27)?[39m
?[90m    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)?[39m
?[90m    at internal/main/run_main_module.js:17:47?[39m {
  code: ?[32m'MODULE_NOT_FOUND'?[39m,
  requireStack: []
}

问题原因:node 版本过高

解决办法:使用nvm切换node版本,我本地使用的是10.19.0版本

D:\sunny\app>nvm list

  * 14.4.0 (Currently using 64-bit executable)
    10.19.0

D:\sunny\app>nvm use 10.19.0
Now using node v10.19.0 (64-bit)

D:\sunny\express>node -v
v10.19.0

D:\sunny\express>forever start -l forever.log -e err.log -a bin/www
warn:    --minUptime not set. Defaulting to: 1000ms
warn:    --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
info:    Forever processing file: bin/www

D:\sunny\express>forever list
info:    Forever processes running
data:        uid  command                            script                  forever pid   id logfile                           uptime
data:    [0] WsNZ "C:\Program Files\nodejs\node.exe" D:\中移铁通\express\bin\www 8368    11216    C:\Users\syy\.forever\forever.log 0:0:0:10.877

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值