slimerjs Can not resolve required module, works with phantomjs

前端 未结 1 1629
旧巷少年郎
旧巷少年郎 2021-02-10 04:19

I am trying to create a testing script so that the testers can capture some tests using standalone slimerjs 0.9.3. However when I try to require a local package that I installe

1条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-10 04:32

    slimer cannot find the node_modules on its own, but you can load the module manually, for instance: var uuid = require(fs.workingDirectory+'/node_modules/node-uuid/uuid.js');

    see the doc on slimerjs require

    0 讨论(0)
提交回复
热议问题