forever: [node v14.x+] Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency

The new node version doesn’t let process to start. whenever

$ forever start app.js

is executed it shows the following warning

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: bot.js
(node:14545) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:14545) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency

and after this if I check with forever list it shows no process is running.

(node:14574) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:14574) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
info:    No forever processes running

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 78
  • Comments: 69 (12 by maintainers)

Commits related to this issue

Most upvoted comments

PLEASE STOP the “same here” posts. We all get it, everyone has this problem. If you want to “vote”, then just thumbs up one of these. Those of us watching this thread don’t need a new notification everyone someone says “me too”.

SAME HERE

I’m done using forever.

As a workaround, I installed NVM and dialed back to node v12.20.0

$ nvm install 12.20.0

  • exports inside the circular dependency This phase gave hint to solve the same issue for me, it seems that newer NodeJS versions no longer allows the circular dependencies. Eg - There are two files - FileA.js, FileB.js Where FileA.js has const FileB = require("FileB"); and FileB.js has const FileA = require("FileA");

After removing one of this it worked!

You can update your dependencies to winston@2.4.5 which should resolve this issue.

Unfortunately this cannot be easily fixed on forever side - reason for the problem is this - https://github.com/winstonjs/winston/issues/1797

Best solution would be to drop dependency on Winston altogether and replace it with something like pino, but unfortunately that would take way more time than I currently have.

PRs welcome. In the meantime, I would recommend to use alternatives to forever, such as pm2 or nodemon on Node 14.

Me too, script doesn’t run and I get the warnings - Node v14.2.0 (Arch Linux)

(node:18643) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency (Use `node --trace-warnings ...` to show where the warning was created)

@elias89 Same I moved to PM2

@SwapnilSoni1999 I don’t think it should prevent application from starting, it’s just a warning. As @naeem518 has mentioned, there was another problem, that was fixed in #1075, that might have prevented forever from working in certain cases. You can try forever 3.0.0 and see if it works any better for you.

@SwapnilSoni1999 I’ll take a look, thanks for the report.

We have:

  1. Flatiron (7y dead) depends on broadway 0.3.2.
  2. Broadway (3y dead) from 1.0.0 (4.1.0 now) is not compatible to 0.3.x
  3. Broadway 0.3.6 (last from 0.x.x) depends both on Winston and Cliff
  4. Cliff (7y dead) depends on Winston too.

I’ve taken a look and couldn’t fix fast.

All this inheritance looks like a dead end for me in using Forever 😦 It really served well.

Having the same issue Ubuntu 18.04.4, node 14.18.1, forever 4.01

What I am using as a work around currently, is running sudo forever. That works perfectly, with no errors. As soon as I run forever as user, it breaks with the error.

forever is installed globally.

after so long, is there any solution for that? i am just using hepipe.js with forever.

if i do forever list i see the forever process up and running, but i still can see the warning there. is reverting to Node.JS 12 the only way to solve this?

OS: Debian Bullseye _ npm -v 6.14.15 node -v v14.17.6 forever --version v4.0.1 (node:2334156) Warning: Accessing non-existent property ‘padLevels’ of module exports inside circular dependency (Use node --trace-warnings ... to show where the warning was created)

forever list (node:2341766) Warning: Accessing non-existent property ‘padLevels’ of module exports inside circular dependency (Use node --trace-warnings ... to show where the warning was created) (node:2341766) Warning: Accessing non-existent property ‘padLevels’ of module exports inside circular dependency info: Forever processes running data: uid command script forever pid id logfile uptime data: [0] QOte /usr/bin/node hepipe.js 2265184 2265468 /var/log/forever/QOte.log 0:0:9:6.956000000000017

_

@akhila9996

You can set the env var NODE_NO_WARNINGS=1 and it goes away, at least it did for me (I’m using the same node & winston version as you)

Yep, still happening - any progress?

I have 14.15.1 installed, and it’s happening in that version for sure.

Confirming with @sapics said.

I am on Ubuntu@16.04, Node@14.2.0. After upgrading from Forever 2.X to Forever 3.0.0, forever start still shows me the error

(node:9923) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:9923) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency

But at least the forever process starts and continues to run unlike before!

Using node v18.18.2 and forever v4.0.3 I still have the error

Yes. Unfortunately, forever is deeply rooted in very outdated libraries.

It looks like a little more fixing will be needed. Specifically, https://github.com/flatiron/cliff/pull/11 needs to get merged and then forever needs to depend on that new version of cliff. (Even after that there may be other instances of similar warnings lurking somewhere.)

What file?

Sent from my iPhone 

Press in Dire Situations http://www.nooooooooooooooo.com/

On Feb 1, 2021, at 2:14 AM, shubham-pixelnx notifications@github.com wrote:

exports inside the circular dependency This phase gave hint to solve the same issue for me, it seems that newer NodeJS versions no longer allows the circular dependencies. Eg - There are two files - FileA.js, FileB.js Where FileA.js has const FileB = require(“FileB”); and FileB.js has const FileA = require(“FileA”); After removing it worked!

Could you please specify what needs to be corrected and the file?

Just remove one import in any of the files if possible.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

same here

forever --version
v3.0.4
(node:503) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)

Still having this problem over a month from this being logged.