简体   繁体   中英

How to tweak an existing nodejs module and use it outside node_modules folder?

I'm using the module node-libcurl . When I deploy my app to Heroku it crashes when I initiate a function from the module (that works on my computer).

Thus I would like to add some logging to the existing node-libcurl module to troubleshoot the issue, and put it in my lib folder outside the node_modules (I excluded it from the git heroku repo).

I added node-pre-gyp lib to the node_modules explicitly.

For information the error is self-explanatory:

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)

I would like to figure out what is the option that I set and that doesn't work on Heroku and that works on my computer.

Thank you!

The key might be in the error messase: An unknown option was passed in to libcurl . It implies that libcurl was told to set/use an option that it doesn't know about. Probably because it is (too) old so your code is using an option that was added to a newer libcurl version and node-libcurl was built to use one or more of those newer options that your older libcurl doesn't know about!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM