Skip to content

ENOENT: no such file or directory #526

@nevosial

Description

@nevosial

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions