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/Enoent: ''no such file or directory'' - how can I circumvent the error?
Next
Answered
Alani O'Kelly
  • 13
Alani O'Kelly
Asked: May 18, 20222022-05-18T21:40:57+00:00 2022-05-18T21:40:57+00:00In: javascript

Enoent: ”no such file or directory” – how can I circumvent the error?

  • 13

. Advertisement .

..3..

. Advertisement .

..4..

Hi everyone, I’m learning about javascript. While working, I try use my Node app in my project. As a result, I get the message:

ENOENT, no such file or directory '~/Desktop/MyApp/newversion/partials/navigation.jade'

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

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

2 Answers

  • Voted
  • Oldest
  • Recent
  • Random
  1. Best Answer
    lyytutoria Expert
    2022-06-22T03:07:23+00:00Added an answer on June 22, 2022 at 3:07 am

    The cause:

    The file you’re looking for is in the current working directory. This is referred to as a relative path. You are not passing the whole path of a file to the open() method in the preceding code, only its name – a relative path. Therefore, the error “FileNotFoundError: [Errno 2] No such file or directory” happens because the working directory does not contain a file with that name.

    Solution:

    Instead of utilizing the relative route, consider using the exact or absolute path. For example, /home/yourusername/Desktop/etcetcetc or you can use process.env.HOME + '/Desktop/blahblahblah'

    Or you can do as the following steps:

    1. First, let’s install npm install .

    2. Then, runnpm cache clean .

    3.npm install -g npm,after that npm install.

    4. Finally, useng serve --o to run the project.

    Above suggestion is also an useful way to solve your error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  2. Poppy Gagnon
    2022-05-26T04:10:25+00:00Added an answer on May 26, 2022 at 4:10 am

    Although I think the answer to the problem is correct, I got this error when installing the npm package (see below).


    enoent:%20no%20such%20file%20or%20directory

    For me, the solution was npm init --yes


    enoent:%20no%20such%20file%20or%20directory

    • 21
    • 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.