如何在Vagrant VM上安装bcrypt? [英] How do I install bcrypt on Vagrant VM?

查看:67
本文介绍了如何在Vagrant VM上安装bcrypt?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试安装bcrypt时,出现此错误

When I try to install bcrypt I get this error

[vagrant@localhost example]$ npm install bcrypt --save
npm ERR! path /vagrant/example/node_modules/bcrypt/node_modules/minipass/node_modules/yallist/package.json.2764337951
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/vagrant/example/node_modules/bcrypt/node_modules/minipass/node_modules/yallist/package.json.2764337951'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2018-06-01T03_52_29_028Z-debug.log

我重新安装了最新版本的node和npm. 在类似情况下我该怎么办?!

I have a fresh install of the latest version of node and npm. What should I do in similar cases?!

推荐答案

我遇到了这个问题.

我认为根本原因是我们无法将bcrypt安装在/vagrant(特殊目录)中,在该目录中它链接回主机OS目录.

I think the root cause is that we can't install bcrypt in the /vagrant (special directory) where it links back to the host OS directory.

该目录就像一个虚拟目录.这样,如果您想解决该问题,则可以将项目从/vagrant/example复制到实际目录,即. 〜/示例.

That directory is like a virtual directory. At such, if you want to solve it you could copy your project from /vagrant/example to an actual directory , ie. ~/example.

然后,您将可以从那里安装bcrypt.

Then you would be able to install bcrypt from there.

** bcrypt是一个与OS本机环境密切相关的库

** bcrypt is a library that has strong dependencies on the OS native environ

这篇关于如何在Vagrant VM上安装bcrypt?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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