6

I tried to install the forever module for node.js on my windows server, but got this error:

C:\rts_lobby>npm install forever
npm http GET https://registry.npmjs.org/forever
npm http 200 https://registry.npmjs.org/forever
npm http GET https://registry.npmjs.org/forever/-/forever-0.8.5.tgz
npm http 200 https://registry.npmjs.org/forever/-/forever-0.8.5.tgz
(...snip...)
npm http GET https://registry.npmjs.org/parse-table

> microtime@0.2.0 install C:\rts_lobby\node_modules\forever\node_modules\microti
me
> node-waf configure build

npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/lazy
npm http GET https://registry.npmjs.org/eventemitter2
'node-waf' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! error installing microtime@0.2.0
npm http GET https://registry.npmjs.org/prompt/0.1.12
(...snip...)
npm http GET https://registry.npmjs.org/mkdirp

> node-fork@0.4.1 preinstall C:\rts_lobby\node_modules\forever\node_modules\node
-fork
> bash ./install

npm http 200 https://registry.npmjs.org/parse-table
npm http 304 https://registry.npmjs.org/mkdirp

> daemon@0.4.1 preinstall C:\rts_lobby\node_modules\forever\node_modules\daemon
> bash ./install

npm http 200 https://registry.npmjs.org/lazy
npm http GET https://registry.npmjs.org/wordwrap
'bash' is not recognized as an internal or external command,
operable program or batch file.
'bash' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! error installing daemon@0.4.1
npm ERR! error installing node-fork@0.4.1
npm ERR! error installing forever@0.8.5
npm http 200 https://registry.npmjs.org/eventemitter2
npm http 200 https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/mkdirp/-/mkdirp-0.0.7.tgz

npm ERR! EEXIST, file already exists 'C:\rts_lobby\node_modules\forever\node_mod
ules\___nconf.npm\package\lib\nconf'
npm ERR! File exists: C:\rts_lobby\node_modules\forever\node_modules\___nconf.np
m\package\lib\nconf
npm ERR! Move it away, and try again.
npm ERR!
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "forever"
npm ERR! cwd C:\rts_lobby
npm ERR! node -v v0.6.8
npm ERR! npm -v 1.1.0-2
npm ERR! path C:\rts_lobby\node_modules\forever\node_modules\___nconf.npm\packag
e\lib\nconf
npm ERR! fstream_path C:\rts_lobby\node_modules\forever\node_modules\___nconf.np
m\package\lib\nconf\common.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code EEXIST
npm ERR! message EEXIST, file already exists 'C:\rts_lobby\node_modules\forever\
node_modules\___nconf.npm\package\lib\nconf'
npm ERR! errno {}
npm ERR! fstream_stack C:\Program Files (x86)\nodejs\node_modules\npm\node_modul
es\fstream\lib\writer.js:161:23
npm ERR! fstream_stack Object.oncomplete (C:\Program Files (x86)\nodejs\node_mod
ules\npm\node_modules\mkdirp\index.js:25:53)

npm ERR! Error: ENOENT, no such file or directory 'C:\rts_lobby\node_modules\for
ever\node_modules\___broadway.npm\package\test\common\directories-test.js'
npm ERR! You may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>
npm ERR!
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "forever"
npm ERR! cwd C:\rts_lobby
npm ERR! node -v v0.6.8
npm ERR! npm -v 1.1.0-2
npm ERR! path C:\rts_lobby\node_modules\forever\node_modules\___broadway.npm\pac
kage\test\common\directories-test.js
npm ERR! fstream_path C:\rts_lobby\node_modules\forever\node_modules\___broadway
.npm\package\test\common\directories-test.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! message ENOENT, no such file or directory 'C:\rts_lobby\node_modules\fo
rever\node_modules\___broadway.npm\package\test\common\directories-test.js'
npm ERR! errno {}
npm ERR! fstream_stack Object.oncomplete (C:\Program Files (x86)\nodejs\node_mod
ules\npm\node_modules\fstream\lib\writer.js:204:26)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\rts_lobby\npm-debug.log
npm not ok

I wouldn't think I was doing anything wrong, but who knows? Anyone have any idea why this may not be working? I'm guessing it has to do with node-waf, which isn't on my system for some reason. Is this not included by default?

Roger Lipscombe
  • 81,986
  • 49
  • 214
  • 348
LordZardeck
  • 7,108
  • 19
  • 55
  • 111
  • See also: http://stackoverflow.com/questions/4018154/node-js-as-a-background-service/12959291#12959291 or http://stackoverflow.com/questions/10547974/how-to-install-node-js-as-windows-service – Page2PagePro Oct 18 '12 at 16:58

3 Answers3

8

I had the same issue installing forever 0.8.4+ on Windows. It seems node-waf is not even available for Windows. Installed forever 0.8.3 as a workaround - just run:

npm install forever=0.8.3
jsalonen
  • 26,663
  • 14
  • 82
  • 104
  • 6
    i also faced the problem in installing forever in windows. Current version is 0.8.5. But 0.8.3 worked. npm install forever@0.8.3. Thanks. – user644745 Mar 08 '12 at 09:53
1

On windows, the best way to keep node running is to use iisnode - http://tomasz.janczuk.org/2011/08/hosting-nodejs-applications-in-iis-on.html and http://weblogs.asp.net/jgalloway/archive/2011/10/26/using-node-js-in-an-asp-net-mvc-application-with-iisnode.aspx

Agree that it is not ideal in all situations, but that is the best we have currently.

sanatgersappa
  • 4,184
  • 2
  • 14
  • 13
0

I assume you using Cygwin? It looks like you either A) did not install bash via cygwin packages or it isn't in your PATH

If you are not using cygwin, you may want to use it because it looks like this package has system dependencies for some linux commands in it's install scripts.

j_mcnally
  • 6,723
  • 1
  • 27
  • 46
  • Wait, i thought that the node team made it where you no longer needed cygwin – LordZardeck Feb 20 '12 at 19:13
  • That doesnt mean that all modules are compatible, node the binary and npm work fine without cygwin, but some modules may still have dependencies in their build scripts requiring Cygwin tools. I think thats may be your problem. – j_mcnally Feb 20 '12 at 20:38
  • Did you re-install node and npm install from Cygwin? Also you need to make sure you're satifying all the npm dependencies in cygwin. For instance node-waf uses python. – j_mcnally Feb 20 '12 at 21:21
  • You will likely need to build node from source in Cygwin. – j_mcnally Feb 20 '12 at 21:22
  • where can I get node-waf? it didn't come with the installation – LordZardeck Feb 20 '12 at 22:17