Uncaught Error: ENOENT: no such file or directory, lstat ‘~/OneDrive\…

[Enter steps to reproduce:]
I am doing a project using node.js and express.
Then:

  1. I created folder a folder called “public” inside the project directory;
  2. I tried to drag a “CSS” folder inside this “public” folder;
  3. Then, I received this error and the suggestion to create this issue.

Atom: 1.45.0 x64
Electron: 4.2.7
OS: Microsoft Windows 10 Pro
Thrown From: Atom Core

Stack Trace

Uncaught Error: ENOENT: no such file or directory, lstat ‘C:\Users\giova\OneDrive\Conhecimento\Cursos\Udemy_Fullstack HTML, CSS, Javascript, Node, React, MongoDB\Section21_EJS\todolist1\ MongoDB’

At fs.js:115

Error: ENOENT: no such file or directory, lstat 'C:\Users\giova\OneDrive\Conhecimento\Cursos\Udemy_Fullstack HTML, CSS, Javascript, Node, React, MongoDB\Section21_EJS\todolist1\ MongoDB'
    at Proxy.realpathSync (fs.js:1435:7)
    at Proxy.fs.realpathSync (ELECTRON_ASAR.js:306:40)
    at TreeView.moveEntry (~/AppData/Local/atom/app-1.45.0/resources/app/static/<embedded>:14:1005297)
    at TreeView.onDrop (~/AppData/Local/atom/app-1.45.0/resources/app/static/<embedded>:14:1012226)
    at HTMLDivElement.<anonymous> (~/AppData/Local/atom/app-1.45.0/resources/app/static/<embedded>:14:985857)

Commands

     -5:03.0 emmet:insert-formatted-line-break-only (input.hidden-input)
     -5:03.0 editor:newline (input.hidden-input)
     -4:59.3.0 autocomplete-plus:confirm (input.hidden-input)
     -4:59.3.0 snippets:expand (atom-text-editor.editor.is-focused.autocomplete-active)
  6x -4:45.7.0 core:backspace (input.hidden-input)
     -4:36.7.0 intentions:highlight (input.hidden-input)
     -4:36.5.0 core:save (input.hidden-input)
  2x -4:32.6.0 tree-view:move (span.name.icon.icon-file-directory)
     -4:21.5.0 core:confirm (input.hidden-input)
     -0:45.1.0 tree-view:add-folder (ol.tree-view-root.full-menu.list-tree.has-collapsable-children.focusable-panel)
     -0:42.9.0 core:move-left (input.hidden-input)
  5x -0:42.6.0 core:backspace (input.hidden-input)
     -0:39.8.0 core:delete (input.hidden-input)
     -0:39.6.0 core:confirm (input.hidden-input)

Non-Core Packages

atom-beautify 0.33.4 
atom-html-preview 0.2.6 
atom-ternjs 0.20.0 
autoclose 0.0.2 
busy-signal 2.0.1 
csslint 1.2.0 
emmet 2.4.3 
hyperclick 0.1.5 
intentions 1.1.5 
jshint 1.8.6 
language-ejs 0.4.0 
linter 2.3.1 
linter-eslint 8.5.5 
linter-ui-default 1.8.1 
pigments 0.40.2 
Sublime-Style-Column-Selection 1.7.5 

1 possible answer(s) on “Uncaught Error: ENOENT: no such file or directory, lstat ‘~/OneDrive\…

  1. Hi @lkashef, I tried the second suggestion and It worked:

    • I would also rename these folders to something basic without spaces or special characters and make sure they exist (Udemy_Fullstack HTML, CSS, Javascript, Node, React, MongoDB and MongoDB)

    This were the project folder:
    C:\Users\giova\OneDrive\Conhecimento\Cursos\Udemy_Fullstack HTML, CSS, Javascript, Node, React, MongoDB\Section21_EJS\todolist1

    And, I renamed to:
    C:\Users\giova\OneDrive\Conhecimento\Cursos\Udemy_Fullstack_nodeJS\Section21_EJS\todolist1

    Then I tried to drag the files and I don’t receive the error message anymore.

    Thank you.