-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: EPERM, rename '...something...' #83
Comments
+1 |
1 similar comment
👍 |
Yeah what is this about? I still can't figure it out. Maybe write access has been blocked in these situations? |
To me it happens when I save a file, watchify kicks in then I quickly save again, before watchify finishes rebuilding the first time. |
I also get it under those circumstances, which occur more frequently for me On Tue, Oct 14, 2014 at 12:12 PM, Dan Caragea notifications@github.com
|
Yes, I have sublime's always save option enabled, so that's probably the case. |
+1 |
Upon further investigation, using a gulp task with watchify is both faster and doesn't seem to suffer from this problem. For me only watchify from the command line had this problem. |
Today I upgraded to watchify 2.1.1 After the upgrade I again got this error and it was definitely not the result of quickly saving files. Below is the error I received and the previous save was some 20 - 30 seconds earlier and resulted in correct output (or at least a notification in the terminal that the output was written correctly, i didnt test the actual bundle.js) Hope this helps |
I can reproduce it with watchify 2.1.1 by doing the following:
This produces the following:
Now that I can reproduce it, I'll take a look at possible fixes when I get a chance. |
@j201 your repro steps give me the same error. |
FWIW, I have a Node script I use to remedy the problem in my scenario. Perhaps it might be useful to fix the issue as well as for people to use before it gets fixed: var browserify = require('browserify');
var fs = require('fs');
var mkdirp = require('mkdirp');
var watchify = require('watchify');
var args = process.argv.slice(2);
var env = args[0];
var shouldWatch = args[1] === '--watch';
var options = (shouldWatch) ? watchify.args : {};
var b = browserify(options);
if (shouldWatch) {
b = watchify(b);
b.on('update', rebundle);
}
b.add('./lib/index.js');
var outdir = './dist/';
mkdirp.sync(outdir);
rebundle();
function rebundle() {
var outpath = outdir + '/index-bundle.js';
b.bundle().pipe(fs.createWriteStream(outpath));
} I hope it's helpful to someone. |
For some reason this seems to fix it on my system: digisfera@f3f61b4 While there isn't a more permanent fix, you can try this version with |
+1, first reported on 15th Aug 2014 and still no official fix... |
+1 |
+1, I had this issue and using the fork @manuelcabral recommended above fixed it. |
+1 This is part of the reason I've been using webpack instead. |
👎 same here, annoying bug. |
+1. Trying to fork from @manuelcabral and if that doesn't work, it's webpack time. |
I'm seeing this as well using 2.4.0 on Windows 7 using Sublime. |
+1 PhpStorm, Windows 7, the first time it compiles without problem, but as soon as i change something and the compilation starts, it reports the blocked file. As long as watchify is running i can't do anything with the file, windows reports ownership as "unable to determine" and doesn't let me do anything with it. Restarting watchify makes it compile once, but as soon as i chang sth. it is the same all over again, rendering watchify virtually useless. It started happening yesterday, after investigating a while i couldn't make out any change i made to the system other that adding and including a new file to my project, very strange indeed... fix by @manuelcabral didn't work unfortunately my gulpfile: ...
gulp.task('clean', function () {
return gulp.src(paths.dist)
.pipe(vinylPaths(del))
.on('error', gutil.log);
});
gulp.task('copy', ['clean'], function () {
gulp.src(paths.assets)
.pipe(gulp.dest(paths.dist + 'assets'))
.on('error', gutil.log);
});
gulp.task('copylibs', ['clean'], function () {
gulp.src(paths.libs)
.pipe(gulpif(!watching, uglify({outSourceMaps: false})))
.pipe(gulp.dest(paths.dist + 'js/lib'))
.on('error', gutil.log);
});
gulp.task('compile', ['clean'], function () {
var bundler = browserify({
cache: {}, packageCache: {}, fullPaths: true,
entries: [paths.entry],
debug: watching
});
var bundlee = function() {
return bundler
.bundle()
.pipe(source('main.min.js'))
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('default'))
.pipe(gulpif(!watching, streamify(uglify({outSourceMaps: false}))))
.pipe(gulp.dest(paths.dist))
.on('error', gutil.log);
};
if (watching) {
bundler = watchify(bundler);
bundler.on('update', bundlee)
}
return bundlee();
});
gulp.task('default', ['connect', 'watch', 'build']);
gulp.task('build', ['clean', 'copy', 'copylibs', 'compile']); Then after first compile when changing sth. and watchify kicks in: ...
[13:41:35] Starting 'compile'...
[13:41:35] { [Error: EPERM, open 'H:\Webpages\dist\main.min.js']
errno: 50,
code: 'EPERM',
path: 'H:\\Webpages\\dist\\main.min.js' }
[13:41:35] 'compile' errored after 178 ms
[13:41:35] Error: EPERM, open 'H:\Webpages\dist\main.min.js'
[13:41:35] { [Error: EPERM, open 'H:\Webpages\dist\main.min.js']
errno: 50,
code: 'EPERM',
path: 'H:\\Webpages\\dist\\main.min.js' } |
As i mentioned before, the error occurred every time i changed a file and watchify kicked in, i didn't install or updated anything previous to the first time the error occurred, i simply added more code (via an extra module). Removing some modules and therefore reducing the compile / clean time let the problem disappear, so it seems to be related to the time the different tasks need. In my case, every time my clean task took more than x ms, i would get the EPERM message. gulp.task('clean', function () {
return gulp.src( './dist/' )
.pipe(vinylPaths(del))
.on('error', gutil.log);
}); I don't know why that is, but this seems to be the trigger (tested with various complexities of my program). Maybe somebody better versed in gulp can figure this one out. |
cmd.js not cli.js ;) |
Thanks, fixed. |
The fix was published as watchify@2.6.2 |
watchify@2.6.2 on win 8.1 looks good! Just tested saving a file with an error then correcting the error and resaving several times. No problems. |
Just had an extensive session on a Windows10 Preview VM, no problems. Definitely a much nicer experience, thanks for the work! |
I am seeing this issue as long as the folder the file is contained in is open in Sublime Text 3. I'm not certain if this is an issue with the editor, watchify or something else, unfortunately. |
This issue only exists in Windows (reproduced on Windows 7); on Ubuntu I do not encounter the same permissions issues. This also cannot be reproduced with Sublime Text 2, so I'll be redirecting my ire toward ST3. |
I use watchify as a npm task in windows, and periodically it stops watching and logs
Restarting fixes it for a while utill the next EPERM error.
The text was updated successfully, but these errors were encountered: