Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.(5)

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

ITtutoria

ITtutoria Logo ITtutoria Logo

ITtutoria Navigation

  • Python
  • Java
  • Reactjs
  • JavaScript
  • R
  • PySpark
  • MYSQL
  • Pandas
  • QA
  • C++
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Python
  • Science
  • Java
  • JavaScript
  • Reactjs
  • Nodejs
  • Tools
  • QA
Home/ Questions/Recommendation for the error: enoent: no such file or directory error
Next
Answered
Louis Lebon
  • 19
Louis Lebon
Asked: May 18, 20222022-05-18T10:53:51+00:00 2022-05-18T10:53:51+00:00In: javascript

Recommendation for the error: enoent: no such file or directory error

  • 19

. Advertisement .

..3..

. Advertisement .

..4..

Hi everyone, I’m learning about javascript. While working, I try start Node server. As a result, I get the message:

embah@devsertwo:~/node/nodeapp$ node app.js
 fs.js:640
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
  ^
 
 Error: ENOENT: no such file or directory, open '/home/embah/node/nodeapp/config/c
 onfig.json'
  at Error (native)
  at Object.fs.openSync (fs.js:640:18)
  at Object.fs.readFileSync (fs.js:508:33)
  at Object.<anonymous> (/home/embah/node/nodeapp/config/config.js:4:28)
  at Module._compile (module.js:570:32)
  at Object.Module._extensions..js (module.js:579:10)
  at Module.load (module.js:487:32)
  at tryModuleLoad (module.js:446:12)
  at Function.Module._load (module.js:438:3)
  at Module.require (module.js:497:17)
  at require (internal/module.js:20:19)
  at Object.<anonymous> (/home/embah/node/glorby/app.js:13:16)
  at Module._compile (module.js:570:32)
  at Object.Module._extensions..js (module.js:579:10)
  at Module.load (module.js:487:32)
  at tryModuleLoad (module.js:446:12)
  at Function.Module._load (module.js:438:3)
  at Module.runMain (module.js:604:10)
  at run (bootstrap_node.js:394:7)
  at startup (bootstrap_node.js:149:9)
  at bootstrap_node.js:509:3
 embah@devsertwo:~/node/nodeapp$

What can I do about the “error: enoent: no such file or directory” issue? Is there a better approach?

enoent no such file or directory
  • 2 2 Answers
  • 88 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook
  • Report

2 Answers

  • Voted
  • Oldest
  • Recent
  • Random
  1. Best Answer
    lyytutoria Expert
    2022-06-08T10:16:37+00:00Added an answer on June 8, 2022 at 10:16 am

    The cause:

    The error happens because your app wants to find a file in  /home/embah/node/nodeapp/config/config.json, but the file doesn’t exist (which is ENOENT).

    Solution:

    This error can be fixed by creating the directory structure expected or configuring your app so that it searches in the correct directory for config.json.

    Another way to solve your problem is checking whether the file path is correct in angular.json file or not:

    "scripts": [
    "node_modules/jquery/dist/jquery.min.js",
    "node_modules/bootstrap/dist/js/bootstrap.js"
    ],

    Then press crtl+c and run the project again.

    • 9
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  2. Arthur Morel
    2022-05-25T20:18:49+00:00Added an answer on May 25, 2022 at 8:18 pm

    After reading through so many threads and links, and becoming frustrated over and again, I decided to go back to basics. It worked. It was all I did.

    npm install

    It might be helpful to someone, I don’t know.

    • 6
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question
  • How to Split String by space in C++
  • How To Convert A Pandas DataFrame Column To A List
  • How to Replace Multiple Characters in A String in Python?
  • How To Remove Special Characters From String Python

Explore

  • Home
  • Tutorial

Footer

ITtutoria

ITtutoria

This website is user friendly and will facilitate transferring knowledge. It would be useful for a self-initiated learning process.

@ ITTutoria Co Ltd.

Tutorial

  • Home
  • Python
  • Science
  • Java
  • JavaScript
  • Reactjs
  • Nodejs
  • Tools
  • QA

Legal Stuff

  • About Us
  • Terms of Use
  • Privacy Policy
  • Contact Us

DMCA.com Protection Status

Help

  • Knowledge Base
  • Support

Follow

© 2022 Ittutoria. All Rights Reserved.

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.