我在我的项目上设置karma
测试,并在我的Mac OSX上运行良好。
但是它在我的linux服务器上失败了。
服务器信息: $ uname -a Linux sz-mc-01 3.13.0-65-generic#106-Ubuntu SMP Fri Oct 2 22:08:27 UTC 2015 x86_64 x86_64 x86_64 GNU / Linux
错误输出:
26 04 2016 15:06:38.065:INFO [launcher]: Starting browser PhantomJS
26 04 2016 15:06:38.069:ERROR [launcher]: No binary for PhantomJS browser on your platform.
Please, set "PHANTOMJS_BIN" env variable.
我设置了#34; PHANTOMJS_BIN"并重新运行,错误是
$ export PHANTOMJS_BIN=node_modules/phantomjs/bin/phantomjs
26 04 2016 15:20:32.857:INFO [launcher]: Starting browser PhantomJS
26 04 2016 15:20:32.935:ERROR [phantomjs.launcher]: internal/child_process.js:274
var err = this._handle.spawn(options);
^
TypeError: Bad argument
at TypeError (native)
at ChildProcess.spawn (internal/child_process.js:274:26)
at exports.spawn (child_process.js:362:9)
at Object.<anonymous> (/mnt/jenkins/workspace/Website_BridgePlus/node_modules/phantomjs/bin/phantomjs:22:10)
at Module._compile (module.js:397:26)
at Object.Module._extensions..js (module.js:404:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:429:10)
at startup (node.js:139:18)
26 04 2016 15:20:32.937:ERROR [launcher]: Cannot start PhantomJS
有什么想法吗?