Skip to content
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

Windows - unhandled error on editing js file #26

Open
seamc opened this issue May 28, 2014 · 3 comments
Open

Windows - unhandled error on editing js file #26

seamc opened this issue May 28, 2014 · 3 comments
Labels

Comments

@seamc
Copy link

seamc commented May 28, 2014

Whenever I edit and save a Javascript file under ~/prj/src/scripts, I receive the error listed below. No further information is provided within the gulp script or the error.

The output below is the same between cygwin and windows command prompt. The error below has occurred on Win7 and Win8 with fresh installs of node.js v0.10.28

$ gulp
[gulp] Using gulpfile ~\Code\pho\gulpfile.js
[gulp] Starting 'scripts'...
[gulp] Starting 'styles'...
[gulp] Starting 'images'...
[gulp] Finished 'images' after 16 ms
[gulp] Finished 'styles' after 125 ms
[gulp] Finished 'scripts' after 152 ms
[gulp] Starting 'index'...
[gulp] Finished 'index' after 91 ms
[gulp] Starting 'default'...
[gulp] Finished 'default' after 277 ms
[gulp] Live reload server listening on: 35729
[gulp] Starting 'scripts'...
[gulp] Starting 'styles'...
[gulp] Finished 'styles' after 9.59 μs
[gulp] Starting 'images'...
[gulp] Finished 'images' after 5.59 ms

events.js:72
throw er; // Unhandled 'error' event
^
Error: EPERM, open '~\pho\dist\scripts\main.js'

@PavelGavlik
Copy link
Collaborator

Have you checked permissions of main.js? User that runs gulp should be able to read/write main.js.

@PavelGavlik
Copy link
Collaborator

OK, my bad. Seems like it doesn't work on Windows properly. I'll look into it.

@seamc
Copy link
Author

seamc commented May 29, 2014

I have not been able to fully debug the problem, but I ran pho through node-inspector and found that the stack dies after gulp's vinyl-fs's mkdirp attempts a write to \dist\scripts\main.js

mkdirp's call stack is as follows:

            // In the case of any other error, just see if there's a dir
            // there already.  If so, then hooray!  If not, then something
            // is borked.
            default:
                fs.stat(p, function (er2, stat) {
                    // if the stat fails, then that's super weird.
                    // let the original error be the failure reason.
                    if (er2 || !stat.isDirectory()) cb(er, made)
                    else cb(null, made); //  <----- pho callback here
                });
                break;

I will try to investigate more; pho seems like a very cool tool, but I am not the fastest with node debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants