npm failed to install time with make not found error

node.js

node.js Problem Overview


When i try to install time on nodejs server i get the below error:

time@0.8.4 install /var/www/track/node_modules/time
node-gyp rebuild
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack     at F (/usr/lib/nodejs/npm/node_modules/which/which.js:43:28)
gyp ERR! stack     at E (/usr/lib/nodejs/npm/node_modules/which/which.js:46:29)
gyp ERR! stack     at /usr/lib/nodejs/npm/node_modules/which/which.js:57:16
gyp ERR! stack     at Object.oncomplete (fs.js:297:15)
gyp ERR! System Linux 3.2.0-31-virtual
gyp ERR! command "node" "/usr/lib/nodejs/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /var/www/track/node_modules/time
gyp ERR! node -v v0.8.15
gyp ERR! node-gyp -v v0.7.1
gyp ERR! not ok
npm ERR! time@0.8.4 install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the time@0.8.4 install script.
npm ERR! This is most likely a problem with the time package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls time
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.2.0-31-virtual
npm ERR! command "nodejs" "/usr/bin/npm" "install" "time"
npm ERR! cwd /var/www/track
npm ERR! node -v v0.8.15
npm ERR! npm -v 1.1.66
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /var/www/track/npm-debug.log
npm ERR! not ok code 0

node.js Solutions


Solution 1 - node.js

Which OS are you using?

If it's Ubuntu you'll need to install the build-essential package:

$ sudo apt-get install build-essential

Then try to install the package again.

Solution 2 - node.js

I had the same problem using Docker, both on CENTOS 7 and RHEL 7 base images... do the following:

RUN yum install -y make gcc*

Worked perfectly for me!

Note: Instead of installing all 69 packages listed in gcc* you can install only what you need for the install nodejs like below

dnf install -y gcc-c++ make 

Solution 3 - node.js

If you are using Windows and npm, install it through cmd (Administrator):

npm install --global --production windows-build-tools

Solution 4 - node.js

For Manjaro/Arch Linux you need to install make and gcc

sudo pacman -S make gcc

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionpeterView Question on Stackoverflow
Solution 1 - node.jsJulián DuqueView Answer on Stackoverflow
Solution 2 - node.jsMarcello de SalesView Answer on Stackoverflow
Solution 3 - node.jsakelecView Answer on Stackoverflow
Solution 4 - node.jsandiFView Answer on Stackoverflow