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

Weird error with cpSync #51712

Closed
Xyndra opened this issue Feb 9, 2024 · 2 comments
Closed

Weird error with cpSync #51712

Xyndra opened this issue Feb 9, 2024 · 2 comments

Comments

@Xyndra
Copy link

Xyndra commented Feb 9, 2024

code:

console.log(join(__dirname, "templates", category, template))
fs.cpSync(join(__dirname, "templates", category, template), path, { recursive: true })

output:

D:\Code\JS_TS\xyndra-templates\lib\templates\ts\test
node:fs:1668
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, lstat '\\?\D:\Code\JS_TS\xyndra-templates\lib\templates\ts\test'
    at lstatSync (node:fs:1668:3)
    at statFunc (node:internal/fs/cp/cp-sync:122:15)
    at getStatsSync (node:internal/fs/cp/cp-sync:123:19)
    at checkPathsSync (node:internal/fs/cp/cp-sync:72:33)
    at cpSyncFn (node:internal/fs/cp/cp-sync:58:42)
    at Module.cpSync (node:fs:3007:3)
    at file:///D:/Code/JS_TS/xyndra-templates/lib/index.js:65:4
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errno: -4058,
  syscall: 'lstat',
  code: 'ENOENT',
  path: '\\\\?\\D:\\Code\\JS_TS\\xyndra-templates\\lib\\templates\\ts\\test'
}

I have found the problematic line, I think:

return `\\\\?\\${resolvedPath}`;

My guess: \\?\... is causing issues, since when I put in the file explorer topbar or cd it gives me an issue.

@Xyndra
Copy link
Author

Xyndra commented Feb 9, 2024

note: I am using Windows 11 with Node.js v18.17.1

@Xyndra
Copy link
Author

Xyndra commented Feb 9, 2024

Wrong directory I misread sorry

@Xyndra Xyndra closed this as not planned Won't fix, can't repro, duplicate, stale Feb 9, 2024
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

1 participant