So I encounter this error while installing node-curl on nodejs v4.2.6 and npm 3.5.2 on Ubuntu 16.04.
Below is the entire npm log:
> email@example.com install /path/to/dir/node_modules/node-curl > sh src/generate_curl_options_list.sh && (node-gyp rebuild || node-waf configure build) extract constants from generate src/integer_options.h cat: '': No such file or directory generate src/string_options.h cat: '': No such file or directory generate src/integer_infos.h cat: '': No such file or directory generate src/string_infos.h cat: '': No such file or directory generate src/double_infos.h cat: '': No such file or directory make: Entering directory '/path/to/dir/node_modules/node-curl/build' CXX(target) Release/obj.target/node-curl/src/node-curl.o In file included from ../src/node-curl.cc:1:0: ../src/node-curl.h:7:23: fatal error: curl/curl.h: No such file or directory compilation terminated. node-curl.target.mk:104: recipe for target 'Release/obj.target/node-curl/src/node-curl.o' failed make: *** [Release/obj.target/node-curl/src/node-curl.o] Error 1 make: Leaving directory '/path/to/dir/node_modules/node-curl/build' gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:269:23) gyp ERR! stack at emitTwo (events.js:87:13) gyp ERR! stack at ChildProcess.emit (events.js:172:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) gyp ERR! System Linux 4.4.0-24-generic gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild" gyp ERR! cwd /path/to/dir/node_modules/node-curl gyp ERR! node -v v4.2.6 gyp ERR! node-gyp -v v3.0.3 gyp ERR! not ok sh: 1: node-waf: not found firstname.lastname@example.org /path/to/dir/ └── email@example.com extraneous npm WARN firstname.lastname@example.org No description npm WARN email@example.com No repository field. npm WARN firstname.lastname@example.org No license field. npm ERR! Linux 4.4.0-24-generic npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "node-curl" npm ERR! node v4.2.6 npm ERR! npm v3.5.2 npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! email@example.com install: `sh src/generate_curl_options_list.sh && (node-gyp rebuild || node-waf configure build)` npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the firstname.lastname@example.org install script 'sh src/generate_curl_options_list.sh && (node-gyp rebuild || node-waf configure build)'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the node-curl package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! sh src/generate_curl_options_list.sh && (node-gyp rebuild || node-waf configure build) npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs node-curl npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls node-curl npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /path/to/dir/npm-debug.log
So I search the web for solutions and somehow I found one. It turns out that node-curl requires you to install libcurl-dev but it’s nowhere to be seen in it’s documentation.
Anyway, so I go ahead and install libcurl-dev.
sudo apt-get install libcurl4-openssl-dev
It seems like it fixes the error I have, but it gives another error. Something like v8 engine error. So I search the web again for another solution. It takes me hours of reading posts and stuff until I stumble upon an issue on github where it says node-curl is dead 2 years ago.
I was like “I spent hours on fixing stuff for a dead package”. But there’s nothing I can do about it, so I started to look for an alternative. And luckily I found two packages that I can use for my project! 😀
I hope this post helped you! Happy coding! 😀