无法安装bcrypt与新公共管理的EC2 [英] Impossible to install bcrypt with npm on EC2

查看:217
本文介绍了无法安装bcrypt与新公共管理的EC2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在上一个Amazon EC2实例的Ubuntu服务器14.04,我在做的时候有一个错误 NPM安装。它没有安装bcrypt(bcrypt:^ 0.8.1在我的的package.json )。

下面是我的错误:

 > bcrypt@0.8.1安装的/ home / Ubuntu的/应用/ node_modules / bcrypt
>节点石膏重建

child_process:customFds选项pcated德$ P $,使用标准输入输出来代替。
令:进入目录`/家庭/ Ubuntu的/应用/ node_modules / bcrypt /建设
  CXX(目标)发布/ obj.target / bcrypt_lib / src目录/ blowfish.o
品牌:G ++:命令未找到
使:*** [发布/ obj.target / bcrypt_lib / src目录/ blowfish.o]错误127
使:离开目录`/家庭/ Ubuntu的/应用/ node_modules / bcrypt /建设
石膏ERR!建立自己的错误
石膏ERR!堆栈错误:`make`失败,退出code:2
石膏ERR!在ChildProcess.onExit栈(/home/ubuntu/node-v0.12.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
石膏ERR!堆叠在ChildProcess.emit(events.js:110:17)
石膏ERR!堆栈Process.ChildProcess._handle.onexit(child_process.js:1067:12)
石膏ERR! Linux系统3.13.0-44泛型
石膏ERR!命令节点/home/ubuntu/node-v0.12.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js重建
石膏ERR! CWD /家庭/ Ubuntu的/应用/ node_modules / bcrypt
石膏ERR!节点-v v0.12.0
石膏ERR!节点石膏-v V1.0.2
石膏ERR!不好
 

解决方案

我刚安装生成工具命令和apt-get安装建立必要的G ++

请注意,你必须 apt-get的更新来避免与易于得到的EC2(否则你可能最终与电子邮件任何问题:无法抓取...

然后 NPM 再次安装,你是好去!

On an Ubuntu Server 14.04 on an Amazon EC2 instance, I had an error when doing npm install. It failed to install bcrypt ("bcrypt": "^0.8.1"in my package.json).

Here's the error I had:

> bcrypt@0.8.1 install /home/ubuntu/app/node_modules/bcrypt
> node-gyp rebuild

child_process: customFds option is deprecated, use stdio instead.
make: Entering directory `/home/ubuntu/app/node_modules/bcrypt/build'
  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
make: g++: Command not found
make: *** [Release/obj.target/bcrypt_lib/src/blowfish.o] Error 127
make: Leaving directory `/home/ubuntu/app/node_modules/bcrypt/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/ubuntu/node-v0.12.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
gyp ERR! System Linux 3.13.0-44-generic
gyp ERR! command "node" "/home/ubuntu/node-v0.12.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ubuntu/app/node_modules/bcrypt
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 

解决方案

I just had to install the build tools sudo apt-get install build-essential g++

Note that you have to apt-get update to avoid any problem with apt-get on EC2 (otherwise you might end up with E: Failed to fetch…

Then npm install again and you're good to go!

这篇关于无法安装bcrypt与新公共管理的EC2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆