2015-10-28 80 views
3

我在我的sailsjs应用程序中使用phantomjs-pdf。此代码在我的本地机器(ubuntu 14.0)中正常工作。但服务器机器(Ubuntu的12.0)引起的错误,如下面phantomjs-pdf不工作

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:339:9)                          
     at Object.exports.execFile (child_process.js:141:15)                       
     at /var/www/test/node_modules/phantomjs-pdf/lib/phantomjs-pdf.js:83:16               
     at /var/www/test/node_modules/phantomjs-pdf/node_modules/async/lib/async.js:721:13            
     at /var/www/test/node_modules/phantomjs-pdf/node_modules/async/lib/async.js:52:16             
     at /var/www/test/node_modules/phantomjs-pdf/node_modules/async/lib/async.js:269:32            
     at /var/www/test/node_modules/phantomjs-pdf/node_modules/async/lib/async.js:44:16             
     at /var/www/test/node_modules/phantomjs-pdf/node_modules/async/lib/async.js:718:17            
     at /var/www/test/node_modules/phantomjs-pdf/node_modules/async/lib/async.js:167:37            
     at async.series.paperFormat (/var/www/test/node_modules/phantomjs-pdf/lib/phantomjs-pdf.js:51:70)         
     at /var/www/test/node_modules/phantomjs-pdf/node_modules/async/lib/async.js:713:13            
     at Immediate.iterate [as _onImmediate] (/var/www/test/node_modules/phantomjs-pdf/node_modules/async/lib/async.js:262:13)   
     at processImmediate [as _immediateCallback] (timers.js:371:17) 

这是我的错误。任何人告诉我什么是问题。帮我。

+0

我有同样的错误:/ –

+0

卸载所有NPM软件包,然后重新安装NPM软件包。 – Aravinth

+0

如果这对你有用,你应该提交它作为答案@Aravinth。 – srph

回答

0

卸载所有NPM软件包,然后重新安装NPM软件包。