2015-02-11 80 views
0

當我試圖部署node.js應用程序(同時使用nodejitsu和heroku)時,我得到了與libxmljs相同的錯誤。libxmljs:找不到scons命令

> [email protected] preinstall /root/tmp/tmp-31613c7bs0y8/build/package/node_modules/twilio/node_modules/libxmljs 
> make node 

make: scons: Command not found 
make: *** [node] Error 127 
npm http 200 https://registry.nodejitsu.com/css-stringify 
npm http 200 https://registry.nodejitsu.com/css-parse 
npm http 200 https://registry.nodejitsu.com/is-promise/-/is-promise-1.0.1.tgz 

> [email protected] preuninstall /root/tmp/tmp-31613c7bs0y8/build/package/node_modules/twilio/node_modules/libxmljs 
> make clean 

make: scons: Command not found 
make: *** [clean] Error 127 
npm http GET https://registry.nodejitsu.com/css-stringify/-/css-stringify-1.0.5.tgz 
npm http GET https://registry.nodejitsu.com/css-parse/-/css-parse-1.0.4.tgz 
npm WARN continuing anyway [email protected] preuninstall: `make clean` 
npm WARN continuing anyway Exit status 2 
npm ERR! [email protected] preinstall: `make node` 
npm ERR! Exit status 2 
npm ERR! 
npm ERR! Failed at the [email protected] preinstall script. 
npm ERR! This is most likely a problem with the libxmljs package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  make node 
npm ERR! You can get their info via: 
npm ERR!  npm owner ls libxmljs 
npm ERR! There is likely additional logging output above. 

npm ERR! System SunOS 5.11 
npm ERR! command "node" "/opt/local/bin/npm" "install" "--loglevel=http" 
npm ERR! cwd /root/tmp/tmp-31613c7bs0y8/build/package 
npm ERR! node -v v0.10.33 
npm ERR! npm -v 1.4.14 
npm ERR! code ELIFECYCLE 

正如你所看到的,它是libxmljs的「接通節點」中失敗,「使乾淨」的命令「scons的」未找到。我的應用程序的node_modules目錄中安裝了libxmljs,'scons'位於「/ usr/local/bin/scons」。

我相信我必須確保scons的位置在libxmljs make環境的路徑中,但我不知道該怎麼做。任何幫助,將不勝感激!

UPDATE:在從這個問題(Fail to deploy node.js application to heroku)的意見,我加入libxmljs到的package.json,並添加node_modules /到的.gitignore的依賴關係,這樣的Heroku可以看看的依賴關係,並安裝它們自己。但是,發生了完全相同的錯誤,這使我相信問題的根源不在我的本地環境中,而是關於libxmljs更大的問題?

回答

0

我能夠解決我的問題,雖然它不是真正特別關於libxmljs。我還在我的應用中使用了'twilio'節點子模塊,但在依賴項中將其版本列爲'0.0.0'。我猜twilio 0.0.0使用了在部署到heroku時不會安裝的libxmljs,因此我將twilio版本號更新爲當前的實際版本,並且一切都很順利!