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

Debugger: Error: ENOENT, no such file or directory #412

Closed
draschke opened this issue Jul 29, 2014 · 25 comments
Closed

Debugger: Error: ENOENT, no such file or directory #412

draschke opened this issue Jul 29, 2014 · 25 comments

Comments

@draschke
Copy link

Hi guys,
I've trouble while debugging with node-inspector.
I use Windows 7, node-inspector 0.7.4, Express: 4.8.3

I've this problem on two different machines.

Ok, what I could find out:

1

Error came up at this point:

fs.statSync = function(path) {
  nullCheck(path);
  return binding.stat(pathModule._makeLong(path));
};

2

The first line shows the path the debugger is looking for..
The second line shows the right path
Debugger - C:\Nodeapp\git bpr 23052014\bpr\node_modules\express.js
Real Path - C:\Nodeapp\git bpr 23052014\bpr\node_modules\express\lib\express.js

3

He founds this pathes
module.js
paths: request = express

0: "c:\Nodeapp\git bpr 23052014\bpr\node_modules"
1: "c:\Nodeapp\git bpr 23052014\node_modules"
2: "c:\Nodeapp\node_modules"
3: "c:\node_modules"
4: "C:\Users\diraschk.node_modules"
5: "C:\Users\diraschk.node_libraries"
6: "c:\Program Files (x86)\lib\node"

4

and brings this path up. ---> is okay!
c:\Nodeapp\git bpr 23052014\bpr\node_modules\express

5

// given a path check
function tryExtensions

0: ".js"
1: ".json"
2: ".node"

6

and brings this path up, but there is no file with this extension
// check if the file exists and is not a directory function tryFile(requestPath)
{ "c:\Nodeapp\git bpr 23052014\bpr\node_modules\express.js"
--> But there is not such a file!
The file is here: C:\Nodeapp\git bpr 23052014\bpr\node_modules\express\lib\express.js

Is there a possibility to skip this error?
Best regards,
Dirk

@draschke
Copy link
Author

Hi guys,
is it possible to install an older version of node-inspector 0.7.4?
I was looking for it, but couldn't find anything.

Would like to check, if the problem could be fixes with an older version.
(Found people with the same problem of this version)

Thanks a lot!

@3y3
Copy link
Member

3y3 commented Aug 13, 2014

Use npm install [email protected] to install oldest version.
Please format your messages. I started to format your issue message but it's not helpful - I understand what Node Inspector not found the requested path to express and I see that this path is wrong for you, but I can't reproduce your situation.
First that I can recommend you - reinstall express
Can you reproduce this situation by extending simple server ?

@draschke
Copy link
Author

I tried at first "npm install [email protected]"
and than "npm install -g [email protected]",
but I'm still on version 7.4 (says the version check "npm info node-inspector version")
???

@draschke
Copy link
Author

"Can you reproduce this situation by extending simple server ?"
No, this simple server works fine with version 7.4.

@draschke
Copy link
Author

"First that I can recommend you - reinstall express"
I think I'll do that, but at the moment I don't know how?

@draschke
Copy link
Author

okay, i get two different results:

$ node-inspector --version
v0.7.3

$ npm info node-inspector version
npm http GET https://registry.npmjs.org/node-inspector
npm http 304 https://registry.npmjs.org/node-inspector
0.7.4

@Jon889
Copy link

Jon889 commented Aug 17, 2014

I get this same issue. It was repeatedly running in the debugger, without changing any source code or anything. I had just honed into the place the bug I was originally trying to find, and then the next time I run with the inspector it came up with this for express. I reinstalled this inspector, and recloned my node js server from github. And this time it was the same error as here except instead of express it was colors.

EDIT: Turning off break on all exceptions (pause-like button in bottom left) makes this go away. But doesn't explain why it suddenly started nor why it suddenly was ok with express and then had a problem with colors.

@draschke
Copy link
Author

i deleted all express files and reinstalled it. but there is no difference, still the same trouble.
also moved the project to c:\project

I forgot to say, that I've the problem on two different computers... and it came up to different times.
Tell me, if you need more informations.

@3y3
Copy link
Member

3y3 commented Aug 18, 2014

@Jon889 , can I see example of failing code anywhere?

@3y3
Copy link
Member

3y3 commented Aug 18, 2014

@draschke , have you other projects without this error, but with installed express?

@draschke
Copy link
Author

@3y3, No.
Today I tried another very simple express project, there is almost no further logic inside.
But exactly the same problem. The project works fine, but if I try to debug it, I get an exception.
exception: Error: ENOENT, no such file or directory
c:\nodeapps\express\express_example\node_modules\express.js

The path is here:
c:\nodeapps\express\express_example\node_modules\express\lib\express.js

@3y3
Copy link
Member

3y3 commented Aug 18, 2014

@draschke, Are you working with this express_example?

@draschke
Copy link
Author

No, but almost the same project.

But I installed it ("express_example") right now and checked, if the behavior is the same.
The same problem:

exception: Error: ENOENT, no such file or directory
c:\nodeapps\express_example-master\node_modules\express.js

The right path is here:
C:\nodeapps\express_example-master\node_modules\express\lib\express.js

@3y3
Copy link
Member

3y3 commented Aug 18, 2014

Ok, it's a good point. Now I can try to reproduce problem in real example. See you later =)
Can you also post the list of global installed packets?

@draschke
Copy link
Author

$ npm list -g --depth=0

[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

gulp and mocha are not important. they were installed after the error came up.

[email protected] is also unnecessary. I installed the generator to get the problem fixed.

@3y3
Copy link
Member

3y3 commented Aug 18, 2014

error

Are you say about this? Or you see error message in other place of debugger (console for example, or terminal...)?

@draschke
Copy link
Author

Yes, thats it!
Here is my screenshot:
image

@Jon889
Copy link

Jon889 commented Aug 18, 2014

It seems that it tries to look for a file called express.js instead or before looking for the express module. Perhaps that's how node decides whether what you're requiring a file or module. As in if there's an exception when looking for express.js then it must be a module called express?

@3y3
Copy link
Member

3y3 commented Aug 18, 2014

Uhm, why I don't ask screenshot at first...!
It's a normal behavior. This is not real error, but an algorithm of fs module - it try to find target file in some places, each place, where it not found, calls the exception.
If you do not want to see this error, disable "Pause on uncaught errors"

@3y3
Copy link
Member

3y3 commented Aug 18, 2014

@Jon889 , have you same problem or different?

@draschke
Copy link
Author

If you do not want to see this error, disable "Pause on uncaught errors" --> where?

@3y3
Copy link
Member

3y3 commented Aug 18, 2014

error

@draschke
Copy link
Author

Oh, no! I don't believe it! ---> It works!!! :)
(I was struggling 2 month with this problem and couldn't really work.)

Big thanks to you!!!

@draschke
Copy link
Author

Really sorry for wasting your time, but I checked the whole internet and couldn't find an answer.

@3y3
Copy link
Member

3y3 commented Aug 18, 2014

No problem =)

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

No branches or pull requests

3 participants