Ask coding questions

← Back to all posts
Why doesn't forever work?
thethermometer (3)

I've installed forever for Node js both in repl's package feature and NPM. When I try to forever run something, i.e. forever start index.js I get:

bash: forever not a command

Or something similar. When I run it in the replit console, I get the error about start.

Did replit just purposely disable this so that we have to use the always on feature?

notGilbert (45)

if the package is installed with npm,

you need to prepend npx to the front of it, since a path variable is not configured for the package forever

notGilbert (45)


make sure forever is installed using npm
bash> npx forever start index.js

thethermometer (3)

@notGilbert Yeah, it runs, but just as if you're running it regularly without forever.

notGilbert (45)

@thethermometer I think that's replit's / forever's problem, if you want something on forever use a ping bot (like uptimerobot) to ping it every 5 minutes or so

2plus2is4hoi (92)

Maybe it's not in the root Bash folder? Probably because of the always on :/

thethermometer (3)

@2plus2is4hoi all my files are in the root

2plus2is4hoi (92)

@thethermometer prolly because of the always on. if you wanted to continuosly run it you need a server or smth or just buy ALWAYS ON