node.js npm 安装时间失败,make not found 错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14772508/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 17:07:24  来源:igfitidea点击:

npm failed to install time with make not found error

node.js

提问by peter

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

当我尝试在 nodejs 服务器上安装 time 时,出现以下错误:

[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

回答by Julián Duque

Which OS are you using?

您使用的是哪个操作系统?

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

如果是 Ubuntu,则需要安装 build-essential 包:

$ sudo apt-get install build-essential

Then try to install the package again.

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

回答by Shashwat Gupta

Simple Solution:

简单的解决方案:

sudo apt-get install build-essential

and try again

然后再试一次

回答by Marcello de Sales

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

我在使用 Docker 时遇到了同样的问题,无论是在 CENTOS 7 还是 RHEL 7 基础镜像上......执行以下操作:

RUN yum install -y make gcc*

Worked perfectly for me!

非常适合我!

回答by akelec

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

如果您使用的是 Windows 和 npm,请通过 cmd(管理员)安装:

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

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

回答by andiF

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

对于 Manjaro/Arch Linux,你需要安装 make 和 gcc

sudo pacman -S make gcc