我使用的是Mac OS X,在终端上我使用的是:
$ sudo npm install node-siege 安装“围攻”。我可以看到在我的文件夹中创建并安装了node-siege文件夹。但是当我运行任何带有围攻的东西时,它给了我-bash: siege.config: command not found不太确定的原因。siege.config,或者任何带有围攻的命令。它给出了命令not found。
编辑我安装了围城,现在它在我的文件夹中,我可以运行它。
我有一台siege.test.js
var siege = require('../../siege')
// Assuming i supposed to change the script below to the directory path then + the file to run??
// For example var siege = require(Localhost/testfolder+'/testthisfile.js')
//siege(__dirname + '/app.js')
siege()
.host('localhost')
.on(3000)
.concurrent(30)
.for(10000).times
.get('/')
.post('/')
.attack()发布于 2015-05-11 22:40:06
node-siege只是名为siege的命令行程序的包装器。
为了在node.js脚本中使用node-siege,您需要首先安装siege命令行工具。如何做到这一点取决于你的操作系统,但在*nix上,它通常可以通过你最喜欢的包管理器获得。
发布于 2019-07-19 18:26:42
你必须安装带有包管理器的围城(例如:brew install Siege)
然后创建一个初始化文件siege.config
siege -c100 -r1 http://localhost:3000/https://stackoverflow.com/questions/30169941
复制相似问题