在 Win7 上捆绑 Meteor 应用程序时出现 ENOTEMPTY 和 EPERM 异常?:( [英] ENOTEMPTY and EPERM exceptions while bundling Meteor application on Win7? :(

查看:45
本文介绍了在 Win7 上捆绑 Meteor 应用程序时出现 ENOTEMPTY 和 EPERM 异常?:(的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

帮助!

我已经使用 Meteor 大约两个月了,在我的 OSX 家庭环境中一切顺利.但是我最近将其中的一些代码带入了我们的 Windows 7 工作环境中,而 Meteor 在 Windows 上的表现并不相同.

I've been working with Meteor for about two months now, and everything is going swimmingly in my OSX home environment. But I recently brought some of that code into our Windows 7 environment at work, and Meteor isn't behaving the same on Windows.

具体来说,代码捆绑不断变得无聊.当我对代码库进行更改时,不是刷新旧的 .meteor/local 目录并重新捆绑应用程序,而是在服务器控制台中向我发出 ENOTEMPTY 异常.如果我在任务资源管理器中停止 mongod 进程并手动删除 .meteor/local 目录,我可以重新启动应用程序,它将捆绑并部署具有新代码更改的应用程序.

Specifically, code bundling keeps getting borked. When I make changes to the code base, instead of flushing the old .meteor/local directory, and rebundling the application, it's barfing a ENOTEMPTY exception at me in the server console. If I halt the mongod process in Task Explorer and manually delete the .meteor/local directory, I can restart the application, and it will bundle and deploy the app with the new code changes.

Running on: http://localhost:3000/
No dependency info in bundle. Filesystem monitoring disabled.
Errors prevented startup:
Exception while bundling application:
Error: ENOTEMPTY, directory not empty 'c:\Users\Abigail\My Documents\GitHub\canvas tracker\.meteor\local\build\server'
    at Object.fs.rmdirSync (fs.js:456:18)
    at Object.module.exports.rm_recursive (c:\Program Files (x86)\Meteor\app\lib\files.js:256:10)
    at c:\Program Files (x86)\Meteor\app\lib\files.js:254:15
    at Array.forEach (native)
    at Function._.each._.forEach (c:\Program Files (x86)\Meteor\lib\node_modules\underscore\underscore.js:79:11)
    at Object.module.exports.rm_recursive (c:\Program Files (x86)\Meteor\app\lib\files.js:252:9)
    at _.extend.write_to_directory (c:\Program Files (x86)\Meteor\app\lib\bundler.js:493:11)
    at Object.exports.bundle (c:\Program Files (x86)\Meteor\app\lib\bundler.js:685:12)
    at exports.run.restart_server (c:\Program Files (x86)\Meteor\app\meteor\run.js:615:26)
    at c:\Program Files (x86)\Meteor\app\meteor\run.js:726:9

Please fix the problem and restart.

但它不再进行动态代码更改和重新捆绑.:(当我尝试启动应用程序时,有时我也会收到 EPERM 错误.

But it doesn't do on-the-fly code changes and re-bundles anymore. :( I'm also getting EPERM errors sometimes when I try launching the application.

Running on: http://localhost:3000/
No dependency info in bundle. Filesystem monitoring disabled.
Errors prevented startup:
Exception while bundling application:
Error: EPERM, operation not permitted 'c:\Users\Abigail\My Documents\GitHub\canvas-tracker\.meteor\local\.build.build'
    at Object.fs.renameSync (fs.js:439:18)
    at _.extend.write_to_directory (c:\Program Files (x86)\Meteor\app\lib\bundler.js:628:8)
    at Object.exports.bundle (c:\Program Files (x86)\Meteor\app\lib\bundler.js:685:12)
    at exports.run.restart_server (c:\Program Files (x86)\Meteor\app\meteor\run.js:615:26)
    at c:\Program Files (x86)\Meteor\app\meteor\run.js:726:9
    at Object.exports.launch_mongo (c:\Program Files (x86)\Meteor\app\lib\mongo_runner.js:146:5)
    at exports.run.launch (c:\Program Files (x86)\Meteor\app\meteor\run.js:712:39)
    at Server.exports.run (c:\Program Files (x86)\Meteor\app\meteor\run.js:770:5)
    at Server.g (events.js:193:14)
    at Server.EventEmitter.emit (events.js:90:17)

Please fix the problem and restart.

有关如何解决此问题的任何想法?我在 Windows 7 Ultimate、SP1、x64 上使用 Meteor 0.5.4.

Any ideas on how to resolve this? I'm using Meteor 0.5.4 on Windows 7 Ultimate, SP1, x64.

我应该提到,只要代码中有错误,就会发生这些错误.在我的 OSX 环境中,如果出现错误,代码仍会编译、缩小和捆绑,页面可能无法呈现,我会在 Chrome 控制台中收到各种 Javascript 错误,然后我必须进行调试.在我的 Win7 环境中,我正在做完全相同的事情,但不是编译一个半损坏的应用程序,然后我可以在 Chrome 中调试,它在捆绑过程中停止.在任何一种情况下,我的 Javascript 代码中都有一个错误(我知道很多).但是在 OSX 中,它仍然会捆绑,我可以继续调试.在 Win7 中,由于这些 ENOTEMPTY 和 EPERM 异常,我无法进入调试步骤...

I should mention that these errors occur whenever there's an error in the code. In my OSX environment, if I have an error, the code will still compile, minify, and bundle, and the page might not render and I'll get various Javascript errors in the Chrome console which I then have to debug. In my Win7 environment, I'm doing the exact same thing, but instead of compiling a semi-broken app that I can then debug in Chrome, it's halting during the bundle process. In either case, there's an error in my Javascript code (I know that much). But in OSX, it will still bundle and I can proceed to debugging. In Win7, I can't get to the debugging step because of these ENOTEMPTY and EPERM exceptions...

而且,是的,我已经尝试通过向所有人授予完全访问权限来取消对整个项目目录的权限.不幸的是,这并没有奏效.

And, yes, I've tried nuking the permissions on the entire project directory by giving Full Access to Everyone. That didn't do the trick, unfortunately.

推荐答案

好的,在 Tom Wijsman 的帮助下,我们设法找到了问题所在.简短的回答是它是 GitHub Bash shell.

Okay, so with the help of Tom Wijsman, we managed to track down the issue. The short answer is that it was the GitHub Bash shell.

长的答案是 ENOTEMPTY 和 EPERM 是由在捆绑过程中未正确删除目录引起的.未正确删除目录是由使用 exec() 命令的代码引起的,该代码将删除命令传递给 shell.结果我使用的是 GitHub Bash shell,它区分大小写,不像标准的 Windows cmd.exe,它不区分大小写.区分大小写导致 shell 无法识别应该删除的路径,因此不会删除它,从而导致捆绑过程中的中断.

The long answer is that ENOTEMPTY and EPERM are caused by a directory not getting deleted correctly during the bundling process. The directory not getting deleted correctly was caused by the code using an exec() command, which passed the delete command off to a shell. Turned out I was using the GitHub Bash shell, which is case sensitive, unlike the standard Windows cmd.exe, which is case insensitive. The case sensitivity was causing the shell not to recognize the path that should be removed, thus not removing it, thus causing a break during the bundle process.

100 倍感谢 Rahul 找到有关此问题的先前错误报告!你是大海捞针的英雄!

100x thanks to Rahul for finding the previous bug reports on this issue! You were the hero that found the needle in the haystack!

这篇关于在 Win7 上捆绑 Meteor 应用程序时出现 ENOTEMPTY 和 EPERM 异常?:(的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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