[英]How to tweak an existing nodejs module and use it outside node_modules folder?
我正在使用node-libcurl
模塊。 當我將應用程序部署到Heroku時,當我從模塊(在我的計算機上可以使用)啟動函數時,它會崩潰。
因此,我想向現有的node-libcurl
模塊添加一些日志記錄以解決該問題,並將其放入node_modules
之外的我的lib文件夾中(我從git heroku存儲庫中排除了它)。
我將node-pre-gyp
gyp lib顯式添加到node_modules中。
有關信息,錯誤是不言自明的:
Error: getInfo failed. Error: An unknown option was passed in to libcurl
at Curl.getInfo (/app/node_modules/node-libcurl/lib/Curl.js:1023:15)
at Object.keys.filter.forEach.key (/app/src/libs/node-libcurl-promise.js:70:23)
at Array.forEach (<anonymous>)
at Curl.curl.on (/app/src/libs/node-libcurl-promise.js:69:6)
at emitThree (events.js:136:13)
at Curl.emit (events.js:217:7)
at Curl._onEnd (/app/node_modules/node-libcurl/lib/Curl.js:929:10)
at Multi.<anonymous> (/app/node_modules/node-libcurl/lib/Curl.js:52:14)
我想弄清楚我設置的選項是什么,它在Heroku上不起作用,並且在我的計算機上起作用。
謝謝!
關鍵可能在錯誤消息中: An unknown option was passed in to libcurl
。 這意味着libcurl被告知設置/使用它不知道的選項。 可能是因為它(太舊),所以您的代碼使用的是已添加到較新的libcurl版本中的選項,而node-libcurl被構建為使用舊的libcurl不知道的那些較新選項中的一個或多個!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.