0
我試圖寫一個角度應用單元測試和現在的描述像因果報應單元測試所有需要的軟件包工作,phantomjs等操作系統:Ubuntu的14NPM安裝:檢查特定的應用程序安裝
問題是,Phantom.js不不安裝在系統(bug description)「libfontconfig」的工作,因爲我知道這是不可能與安裝:
npm install --save-dev libfontconfig
如何輸出給用戶警告,某些安裝當他試圖做時是必需的:
npm install
UPD
我決定提供我的情況更具體的細節。所以,我要使用Karma和Phantom.js來測試我的應用程序。這裏有一個項目的所有devDependencies:
"devDependencies":
{
"grunt": "~0.4.5",
"grunt-contrib-less": "~1.1.0",
"grunt-contrib-watch": "~0.6.1",
"jit-grunt": "~0.9.1",
"angular-route": "~1.4.8",
"angular": "~1.4.8",
"moment": "~2.10.6",
"jquery": "~1.11.3",
"bootstrap": "~3.3.6",
"angularjs-datepicker": "~0.2.16",
"phantomjs": "~1.9.8",
"karma": "^0.12.16",
"karma-jasmine": "~0.1.0",
"karma-phantomjs-launcher": "~0.2.3"
}
當我嘗試用噶運行單元測試:
node node_modules/karma/bin/karma start test/karma.conf.js
我收到以下錯誤:
ERROR [phantomjs.launcher]: /vagrant/node_modules/phantomjs/lib/phantom/bin/phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory
所以,我的問題是:
1)我應該檢查這個庫的存在,或者我可以在README中描述它嗎?
2)如果我應該檢查,我該怎麼做?使用bash是一個好主意嗎?據我所知,在這種情況下它不會在Windows機器上工作。
謝謝你的回答,我有一個想法,但我仍然不明白如何從nodeJS獲取系統中安裝的應用程序的信息? – Tamara
您需要在您在安裝後字段中設置的腳本中執行與此http://stackoverflow.com/a/15303236類似的操作。 – Kody
好吧,我試過這種方法,但是看起來我無法檢查應用程序是否安裝在操作系統中 - 我只能在此處檢查npm模塊。而「libfontconfig」不是一個npm模塊。也許可以在這裏使用一些bash腳本? – Tamara