我在Xubuntu上执行此命令时遇到了几个错误;
npm install -g yo generator-hubot
按照这篇文章的说明
https://arthacker.net/how-to-install-hubot-on-ubuntu-14-04-lts-de3263cead51#.2c45h2a4f
我假设当我到达必须做的步骤时,我的错误可能是跳跃命令; sudo ln -s / usr / bin / nodejs / usr / bin / node但是我得到了一个错误(文件存在),因此我认为它是好的,所以我转移到上面提到的产生错误的下一步。
root@sa-VPCW11S1E:/home/sa# npm install -g yo generator-hubot
npm WARN deprecated CSSselect@0.4.1: the module is now available as 'css-select'
npm WARN deprecated CSSwhat@0.4.7: the module is now available as 'css-what'
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm ERR! Linux 4.4.0-45-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "yo" "generator-hubot"
npm ERR! node v7.0.0
npm ERR! npm v3.10.9
npm ERR! shasum check failed for /tmp/npm-4682-604231ef/registry.npmjs.org/rx/-/rx-2.5.3.tgz
npm ERR! Expected: 21adc7d80f02002af50dae97fd9dbf248755f566
npm ERR! Actual: 84e6ac5ecfa4396589730d136d466c7e41c15a4a
npm ERR! From: https://registry.npmjs.org/rx/-/rx-2.5.3.tgz
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /home/sa/npm-debug.log
root@sa-VPCW11S1E:~# npm -v
3.10.9
root@sa-VPCW11S1E:~# node -v
v7.0.0
答案 0 :(得分:0)
使用命令解决问题;
Tools::redirect($newUrlToRedirect);
之后重复命令;
class cartportkeyDeriverModuleFrontController extends ModuleFrontController {
public function init(){
//I am in the url http://localhost/shopgroup/shopnameCART/quick-order and
//check the postal code, then clicking a link I go to the URL
//http://localhost/shopgroup/shopnameNEW/index.php?fc=module&module=cartportkey&controller=deriver&id_cart=XXX&id_shop=YYY
parent::init();
$id_cart = (int)Tools::getValue('id_cart');
$id_shop = (int)Tools::getValue('id_shop');
$this->context->cookie->id_cart = $id_cart;
$link_order = $this->context->link->getPageLink('order');
$testShop = Context::getContext()->shop;
//HERE I OBTAIN THE storeOLD instead storeNEW so I am redirecting again to storeOLD
$testShop = json_decode(json_encode($testShop), true);
$newUrlToRedirect = "http://".$testShop['domain'].$testShop['physical_uri'].$testShop['virtual_uri'].'quick-order';
//print $newUrlToRedirect;
$cart = new Cart(33);
$cart->delete();
Tools::redirect($newUrlToRedirect);
}
public function initContent() {
parent::initContent();
}
}
让你的发电机正常工作。虽然我仍然难以与Hubot互动。 (启动hubot并发送诸如hubot帮助之类的命令后没有响应)。