Grunt Serve watch 对 mongod.lock 发出 EBUSY 警告 [英] Grunt Serve watch throws EBUSY warning over mongod.lock

查看:60
本文介绍了Grunt Serve watch 对 mongod.lock 发出 EBUSY 警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序正在使用全栈 angular yeoman 生成器构建.我开始 mongod 将路径传递到我的数据文件夹:

I have an app I am building using the full stack angular yeoman generator. I start mongod passing the path to my data folder:

[我的本地路径]/[我的新应用名称]/server/data

[my local path]/[my new app name]/server/data

然后在我的应用程序中运行 grunt serve 任务.应用程序正确启动,但是 watch 任务会发出警告,然后无法进行任何实时重新加载,这也会导致浏览器中的应用程序持续加载.

In my app i then run the grunt serve task. The app boots up correctly however the watch task throws a warning and then fails to do any live reloads it also causes the app in the browser to continuously load.

我收到的警告:

EBUSY,资源繁忙或锁定[我的本地路径]/[我的新应用程序名称]/server/data/mongod.lock"

EBUSY, resource busy or locked "[my local path]/[my new app name]/server/data/mongod.lock"

不确定发生了什么我读到的关于这一切表明我打开了多个实例试图访问数据库,但我很确定我没有.

Not sure what is going on everything I have read about this suggests that I have multiple instances open trying to access the DB but I am pretty sure I do not.

L

推荐答案

所以在输入上述问题后,我很快意识到我做错了什么.

So after typing the above question I realised what I did wrong pretty quickly.

确保 GRUNT 没有监视您的数据文件夹

MAKE SURE YOUR DATA FOLDER IS NOT BEING WATCHED BY GRUNT

我的数据文件夹位于由 yeoman 项目创建的服务器文件夹中,该项目被 grunt 监视,但也被 mongod 锁定.我移动了我的数据文件夹(我相信你可以忽略数据目录),现在它运行良好.

I had my data folder within the server folder created by the yeoman project which was being watched by grunt but also locked by mongod. I moved my data folder (I am sure you could ignore the data directory instead) and it now works well.

我希望这可以为其他人节省 20 分钟的时间来弄清楚:)

I hope this saves someone else the 20 mins it took me to figure it out :)

L

这篇关于Grunt Serve watch 对 mongod.lock 发出 EBUSY 警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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