Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI not finding script #108

Closed
nmcclay opened this issue Aug 29, 2011 · 19 comments
Closed

CLI not finding script #108

nmcclay opened this issue Aug 29, 2011 · 19 comments

Comments

@nmcclay
Copy link

nmcclay commented Aug 29, 2011

Attempting to start forever I get the following:

BlahBlah:node-api user$ forever start src/api.js 
info:   Running action: start
info:   Forever processing file: start
error:  Cannot start forever
error:  script /Users/Me/Documents/storage/dev/web/node-api/start does not exist.

Inside /bin/forever this file is determined with

var file = argv._[0]

When I change the index to 1 this finds the file argument correctly. If this has changed it doesn't match the CLI help's usage and example reference.

@indexzero
Copy link
Member

@nmcclay I cannot reproduce this

$ forever start examples/server.js 
info:   Running action: start
info:   Forever processing file: examples/server.js
$ forever list
info:   Running action: list
info:   Forever processes running
data:       uid  command script             forever pid  logfile                          uptime     
data:   [0] pAXp node    examples/server.js 3194    3225 /Users/Charlie/.forever/pAXp.log 0:0:0:0.62

What version of forever are you using? Are you sure you're on 0.6.6?

@nmcclay
Copy link
Author

nmcclay commented Aug 29, 2011

Here is my install output from npm:

Blah-MacBook-Pro:node-api user$ npm install forever -g

> [email protected] preinstall /usr/local/lib/node_modules/forever/node_modules/daemon
> node-waf configure build

Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : ok /usr/local/lib/node 
Checking for node prefix                 : ok /usr/local 
'configure' finished successfully (0.085s)
Waf: Entering directory `/usr/local/lib/node_modules/forever/node_modules/daemon/build'
[1/2] cxx: src/daemon.cc -> build/default/src/daemon_1.o
[2/2] cxx_link: build/default/src/daemon_1.o -> build/default/daemon.node
Waf: Leaving directory `/usr/local/lib/node_modules/forever/node_modules/daemon/build'
'build' finished successfully (0.380s)
/usr/local/bin/forever -> /usr/local/lib/node_modules/forever/bin/forever
[email protected] /usr/local/lib/node_modules/forever 
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected] [email protected])
└── [email protected]

I'm running on node 0.4.11 as well.

@simenbrekken
Copy link

I'm getting the same thing on a fresh EC2 instance.

info:   Running action: start
info:   Forever processing file: start
error:  Cannot start forever
error:  script /home/ec2-user/start does not exist.

@SlexAxton
Copy link

I also get this error (on EC2)

In it's most simple form:

cd /var/www/deploydir
forever start app.js
info:   Running action: start
info:   Forever processing file: start
error:  Cannot start forever
error:  script /var/www/deploydir/start does not exist.

forever is the latest and is installed globally. npm install forever -g
node -v is v0.4.8

@rickygrows
Copy link

another one with this error. exactly as SlexAxton typed it.

@simenbrekken
Copy link

I've tried downgrading down to 0.6.3 stepwise but with the same results, maybe a dependency has broken somewhere?

@SlexAxton
Copy link

Dependency is a good thought. It's certainly not a core node dependency (by upgrading to v0.4.11 or something).

From the package.json file

"dependencies": {
    "async": "0.1.x",
    "colors": "0.x.x",
    "cliff": "0.x.x",
    "eyes": "0.1.x",
    "daemon": "0.3.x",
    "mkdirp": "0.x.x",
    "nconf": "0.x.x",
    "optimist": "0.2.x",
    "pkginfo": "0.x.x",
    "portfinder": "0.x.x",
    "timespan": "2.0.x",
    "winston": "0.4.x"
}

So most of them are not 'locked in' from an exact version standpoint. Most should be just bugfixes though. Does any of that make sense though? daemon? I'm not intimately familiar with all of them though.

@indexzero
Copy link
Member

Cannot repro on my machine. It smells like a dependency bug.

Roll call. Please paste the results from "npm ls" if you are having this issue


$ npm ls
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
[email protected] /Users/Charlie/GitHub/forever
├── [email protected] 
├─┬ [email protected] 
│ └─┬ [email protected] 
│   └─┬ [email protected] 
│     └── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├─┬ [email protected] 
│ └── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
└─┬ [email protected] 
  ├─┬ [email protected] 
  │ └── [email protected] 
  └── [email protected] 
npm info ok

@simenbrekken
Copy link

Here's a diff of npm list forever -g from my staging (EC2, same AMI but forever is working) and live:

-staging:
+live:

-├─┬ [email protected] 
+├─┬ [email protected] 
 │ ├── [email protected] 
-│ ├── [email protected] 
+│ ├─┬ [email protected] 
+│ │ └─┬ [email protected] 
+│ │   └─┬ [email protected] 
+│ │     └── [email protected] 
 │ ├── [email protected] 
 │ ├── [email protected] 
 │ ├── [email protected] 
-│ ├── [email protected] 
-│ ├── [email protected] 
+│ ├── [email protected] 
+│ ├─┬ [email protected] 
+│ │ └── [email protected] 
 │ ├─┬ [email protected] 
-│ │ └── [email protected] 
+│ │ └── [email protected] 
 │ ├── [email protected] 
 │ ├── [email protected] 
 │ ├── [email protected] 
-│ └─┬ [email protected] 
-│   └─┬ [email protected] 
-│     └── [email protected] 
-└─┬ [email protected] 
+│ └─┬ [email protected] 
+│   ├─┬ [email protected] 
+│   │ └── [email protected] 
+│   └── [email protected] 
+└─┬ [email protected] 
   ├── [email protected] 
   ├── [email protected] 
+  ├── [email protected] 
   ├─┬ [email protected] 
   │ └── [email protected] 
   ├── [email protected] 
   ├── [email protected] 
+  ├── [email protected] 
+  ├── [email protected] 
   ├── [email protected] 
-  └── [email protected] 
+  ├── [email protected] 
+  └── [email protected] 

And per request just the npm ls from live:

├─┬ [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ └─┬ [email protected] 
│ │   └─┬ [email protected] 
│ │     └── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ └─┬ [email protected] 
│   ├─┬ [email protected] 
│   │ └── [email protected] 
│   └── [email protected] 
└─┬ [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├─┬ [email protected] 
  │ └── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  └── [email protected] 

@SlexAxton
Copy link

[user@machine current]# npm ls
[email protected] /var/www/directory
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├─┬ [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ └── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
└── [email protected]

Then the npm list forever -g

/usr/local/lib
├─┬ [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ └─┬ [email protected] 
│ │   └─┬ [email protected] 
│ │     └── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ └─┬ [email protected] 
│   ├─┬ [email protected] 
│   │ └── [email protected] 
│   └── [email protected] 
└─┬ [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├─┬ [email protected] 
  │ └── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  └── [email protected]

@indexzero
Copy link
Member

Ok, confirmed. This is a regression I introduced in [email protected]. [email protected] took optimist as a dependency for enabling CLI overrides to configuration stores. I will push out a fix today.

@SlexAxton
Copy link

Thanks!

@indexzero
Copy link
Member

This is resolved. [email protected] has been released which lazy-loads optimist. I have unpublished [email protected] since it had this bug. Therefore you simply need to reinstall forever, which will grab the new version of nconf:

  $ [sudo] npm uninstall forever [-g]
  $ [sudo] npm install forever [-g]

Remark: As noted above, use sudo and -g according to your current install preferences.

@SlexAxton
Copy link

@rickygrows
Copy link

confirmed working here. had to:

npm uninstall forever
npm uninstall nconf
npm cache clean (removes all downloaded install files related to npm modules)
npm install forever

pro status. thanks a ton for the fix.

@simenbrekken
Copy link

Confirmed here as well, thanks for the quick fix!

@nmcclay
Copy link
Author

nmcclay commented Aug 29, 2011

Awesome, works for me again :)

@cdarne
Copy link

cdarne commented Aug 30, 2011

It worked great for me too, thanks!

@marksherman
Copy link

Message from the future: this error comes up whenever you give an unknown action command to forever, like forever log which isn't a thing (clearly meant forever logs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants