无法永远安装在Windows上?

时间:2012-02-20 19:07:18

标签: node.js

我尝试在我的Windows服务器上安装node.js的forever模块,但是出现了这个错误:

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

我不认为我做错了什么,但谁知道呢?任何人都知道为什么这可能不起作用?我猜这与node-waf有关,因为某种原因,它不在我的系统上。这是不是默认包括在内?

3 个答案:

答案 0 :(得分:8)

我有同样的问题在Windows上永远安装0.8.4+。似乎node-waf甚至不适用于Windows。永远安装0.8.3作为解决方法 - 只需运行:

npm install forever=0.8.3

答案 1 :(得分:1)

在Windows上,保持节点运行的最佳方法是使用iisnode - http://tomasz.janczuk.org/2011/08/hosting-nodejs-applications-in-iis-on.htmlhttp://weblogs.asp.net/jgalloway/archive/2011/10/26/using-node-js-in-an-asp-net-mvc-application-with-iisnode.aspx

同意在所有情况下都不理想,但这是我们目前最好的。

答案 2 :(得分:0)

我假设你使用Cygwin?它看起来像你A)没有通过cygwin包安装bash或它不在你的PATH

如果你没有使用cygwin,你可能想要使用它,因为看起来这个包在它的安装脚本中对某些linux命令有系统依赖性。

相关问题