Comments (11)
I went ahead and started the same script in bash, and the script successfully finds the forever command, but not node:
/usr/bin/env: node: No such file or directory
Anyone have an ideas?
from forever.
@spadeworkers: your individual user account seems to have a node path set in your bash environment, but the user trying to run the cron job, sometimes a separate cron
user, doesn't. You could either try to change the path settings for the cron user, or only give cron fully qualified paths.
Let me know if this is still a problem or if you have other questions.
from forever.
Thanks for the response. I realize I should have added the -c argument to the command adding the full path to the node app. Though even after I did that I am still getting the node error. Even the list command returns the same error. The command I'm running is:
/usr/local/lib/node/.npm/forever/0.4.1/package/bin/forever -v -c /home/xxxxx/node/node list
Error is:
/usr/bin/env: node: No such file or directory
Its as if the -c argument is not working.
from forever.
@spadeworkers The -c
option is only for the executable that you want any processed to be spawned with. The problem is here (I suspect): https://github.com/indexzero/forever/blob/master/bin/forever#L1
I'm not sure the best way to make this run across multiple possible node locations. @AvianFlu do you know if its possible to replace:
#!/usr/bin/env node
with something like:
#!which node
from forever.
@indexzero: it would have to be #! /usr/bin/which node
, but I don't otherwise see a problem.
from forever.
@AvianFlu This doesn't seem to work. I modified and linked my local forever and tried forever list
. The output was unexpected and is below:
$ forever list
/usr/local/bin/node
/usr/local/bin/forever
from forever.
@spadeworkers I believe I have found a solution to your problem. Can you try running
$ node `which forever` list
I'm not sure the right approach to fixing this in forever core. A comment from anyone with serious bash-fu would be welcome.
from forever.
I have encountered the same - which
used in a hashbang results in the string, rather than the command being executed.
/usr/bin/env
actually adds node
to the environment before running it - provided the shell in question has something useful to associate the word node
with. The real question is how to make sure node
is in a given user's path so that the shell knows what to do.
from forever.
Having one's absolute node
path in the hashbang would work for this. #!/usr/bin/node
or what have you.
from forever.
@indexzero I ran the command you suggested:
node `which forever` list
and it works fine from the command line, but then I had this run from the cron:
/usr/local/bin/node `which forever` list
and I get this error:
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module '/home/xxxxx/list'
at Function._resolveFilename (module.js:320:11)
at Function._load (module.js:266:25)
at Array.<anonymous> (module.js:423:10)
at EventEmitter._tickCallback (node.js:126:26)
1
'/home/xxxxx/' is the home folder for the user under which the cron job is running
from forever.
This should be fixed in the 0.6.x
branch
from forever.
Related Issues (20)
- Windows 10: current version of forever ? HOT 1
- forever/bin/monitor still keep the output log File descriptor in memory although i deleted them HOT 1
- Vulnerable dependencies on [email protected] HOT 3
- Run forever script on Windows, show processing but not forever processes running
- [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type number (1505) HOT 3
- security fix: pin or replace `colors` dependency HOT 14
- Running the "forever list" on ubuntu showing the following output HOT 3
- stopall gets stuck sometimes
- --plain flag is ignored/does not work in forever 4.0.3 HOT 2
- latest version has vulnarable dependencies HOT 1
- Uptime format
- Issue starting multiple servers in one command
- any guide for next js 13?
- how to find the exit reason of process HOT 1
- AIX 7.3 TL 1 forever errors
- how to save old history log instead of delete.. HOT 1
- forever --version Can run, but there are errors(v4.0.3) HOT 1
- redhat 9 enterprise clean install, getting Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
- uptime format
- Log Bigsize
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from forever.