我有一个构建过程……其中一个步骤是在PhantomJS上使用Karma运行测试.不幸的是,karma-phantomjs-launcher会自动获取“phantomjs-prebuilt”:“> = 1.9”,这会从互联网上获取最新的PhantomJS(2.1.1).在
Linux机器上我收到此错误:
[11:21:15][Step 1/1] > gom-filters@1.0.4 test /sbclocal/apps/BuildAgent/work/5d1d4b9ee540b3ac
[11:21:15][Step 1/1] > karma start test/karma.conf.js --single-run --browsers PhantomJS
[11:21:15][Step 1/1]
[11:21:17][Step 1/1] 16 03 2016 11:21:17.569:INFO [karma]: Karma v0.13.21 server started at http://localhost:9876/
[11:21:17][Step 1/1] 16 03 2016 11:21:17.583:INFO [launcher]: Starting browser PhantomJS
[11:21:17][Step 1/1] 16 03 2016 11:21:17.603:ERROR [phantomjs.launcher]: /sbclocal/apps/BuildAgent/work/5d1d4b9ee540b3ac/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs: /usr/lib64/libz.so.1: no version information available (required by /sbclocal/apps/BuildAgent/work/5d1d4b9ee540b3ac/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs)
[11:21:17][Step 1/1] /sbclocal/apps/BuildAgent/work/5d1d4b9ee540b3ac/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /sbclocal/apps/BuildAgent/work/5d1d4b9ee540b3ac/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs)
[11:21:17][Step 1/1] /sbclocal/apps/BuildAgent/work/5d1d4b9ee540b3ac/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sbclocal/apps/BuildAgent/work/5d1d4b9ee540b3ac/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs)
[11:21:17][Step 1/1] /sbclocal/apps/BuildAgent/work/5d1d4b9ee540b3ac/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs: /lib64/libc.so.6: version `GLIBC_2.9' not found (required by /sbclocal/apps/BuildAgent/work/5d1d4b9ee540b3ac/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs)
[11:21:17][Step 1/1] /sbclocal/apps/BuildAgent/work/5d1d4b9ee540b3ac/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs: /lib64/libc.so.6: version `GLIBC_2.10' not found (required by /sbclocal/apps/BuildAgent/work/5d1d4b9ee540b3ac/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs)
[11:21:17][Step 1/1] /sbclocal/apps/BuildAgent/work/5d1d4b9ee540b3ac/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs: /lib64/libc.so.6: version `GLIBC_2.7' not found (required by /sbclocal/apps/BuildAgent/work/5d1d4b9ee540b3ac/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs)
我试图手动启动PhantomJS 1.9.8,它工作正常.
有没有办法强制下载1.9.8而不是最新的(2.1.1)?
最佳答案 在package.json中明确指定PhantomJS依赖版本为1.9.8解决了这个问题.