2013-02-08 73 views
52

当我尝试的NodeJS服务器上安装时,我得到下面的错误:NPM未能安装时用make找不到错误

[email protected] 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! [email protected] install: `node-gyp rebuild` 
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1 
npm ERR! 
npm ERR! Failed at the [email protected] 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 
+0

请更新此帖以显示您正在使用的操作系统。当前的答案适用于Ubuntu,但是,如果您澄清了您的操作系统类型,它将对其他人有所帮助。 – JnL 2014-09-23 03:31:53

回答

192

哪个操作系统您使用的?

如果是Ubuntu的,您需要安装build-essential这个包:

$ sudo apt-get install build-essential 

然后尝试再次安装该软件包。

+0

它解决了我的问题! – temple 2014-09-17 23:45:52

+1

答案对于Ubuntu操作系统是正确的。 – JnL 2014-09-23 03:32:31

+0

我正面临与MAC OS相同的问题。请你指导我如何设置MAC。 – Learner 2014-11-19 13:03:19

7

我使用泊坞窗有同样的问题,无论是在CentOS 7和RHEL 7成碱基图片...请执行以下操作:

RUN yum install -y make gcc* 

完全为我工作!

+1

我想你只是为我节省了一堆时间。谢谢!我尝试了'gcc *',但没有奏效。 CENTOS 7 – Bill 2016-10-27 22:44:38

+0

谢谢,在centos上为我工作'7.3.1611' – 2017-06-12 16:55:19

+1

非常感谢,经过两年多的时间从这篇文章中。它拯救了我的一天! – 2017-11-07 17:58:01