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

ENOENT: no such file or directory #526

Open
nevosial opened this issue Apr 22, 2017 · 2 comments
Open

ENOENT: no such file or directory #526

nevosial opened this issue Apr 22, 2017 · 2 comments

Comments

@nevosial
Copy link

Issue observed.

I'm facing this issue when i run all learnyounode exercises requiring the 'fs' module. I see this issue while running it on the linux(ubuntu 14.04LTS) machine and not in the windows environment.( I have run the exercises successfully on a windows 10 machine).
I feel it is related to the environment setup but i'm not sure. i have installed both the nodejs and the npm packages globally (- g).

  • node version: 7.9.0
  • npm version: 4.5.0
  • os: Ubuntu 14.04 LTS

Error output

 93
fs.js:584
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open '93'
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.readFileSync (fs.js:491:33)
    at Object.<anonymous> (/home/nev/repos/learnode/ex03.js:16:19)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:423:7)

My Code

 var fs = require('fs');
console.log(process.argv[2]);
var contents = fs.readFileSync(process.argv[2], 'utf-8');
var lines = contents.split('\n').length - 1;
console.log(lines);
@francesmcmullin
Copy link

Are you sure you have the correct exercise selected? I see output like that if I try to verify your program for the previous exercise (baby steps), but it works fine for the third exercise (my first i/o!).

Here's what my output looks like:

  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open '48'
    at Object.fs.openSync (fs.js:558:18)
    at Object.fs.readFileSync (fs.js:468:33)
    at Object.<anonymous> (/home/cocoa/prog.js:3:19)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:418:7)

Your submission results compared to the expected:

                 ACTUAL                                  EXPECTED                 
────────────────────────────────────────────────────────────────────────────────

   "48"                                !=    "123"                              
   ""                                  ==    ""                                 

────────────────────────────────────────────────────────────────────────────────

✗ Submission results match expected

# FAIL

Your solution to BABY STEPS didn't pass. Try again!

@AnshulMalik
Copy link
Contributor

@nevosial Is your issue resolved?

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