question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Forever with `npm start`

See original GitHub issue

Hi,

I’m normally starting my script with npm start to get access to the user environment, which includes variables from the package.json (e.g. process.env.npm_package_config_port).

Is there a way to start my script with npm start in forever? Or an alternative way to get the npm environment variables when starting the script with forever?

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Reactions:5
  • Comments:23 (2 by maintainers)

github_iconTop GitHub Comments

263reactions
noazarkcommented, Mar 16, 2014

This should work:

forever start -c "npm start" /path/to/app/dir/

So running from your application’s directory you could just use ‘./’ as your path.

27reactions
dineshsprabucommented, Jan 28, 2016

Solution for NPM START problem with forever.

https://gist.github.com/dineshsprabu/e7553cc9cc2f23b5c696

Read more comments on GitHub >

github_iconTop Results From Across the Web

forever - npm
A simple CLI tool for ensuring that a given node script runs continuously (i.e. forever). Latest version: 4.0.3, last published: a year ago....
Read more >
nodejs forever : How to run my npm application - Stack Overflow
i want to run it in background. I found forever package for this but dont know how can i run a application that...
Read more >
Running Node.js scripts continuously using forever
Forever is an npm module that ensures a Node.js script continuously runs in the background on the server. It's a helpful CLI tool...
Read more >
How to run your Node server continuously with forever
To start running a script with forever, use the forever start command, followed by the script name. Here's an example: # running a...
Read more >
Making your node apps run on startup and forever | milose
Forever is a simple CLI tool for ensuring that a given script runs continuously (i.e. forever). Install it globally using NPM: $ [sudo]...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found