Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

fs.symlink wrong error message #21852

Closed
dmail opened this issue Apr 26, 2015 · 6 comments
Closed

fs.symlink wrong error message #21852

dmail opened this issue Apr 26, 2015 · 6 comments

Comments

@dmail
Copy link

dmail commented Apr 26, 2015

When I run require('fs').symlinkSync('existing/folder/path', 'bad/folder/path', 'dir')

Results in
Error: ENOENT, no such file or directory 'existing/folder/path'
Instead of
Error: ENOENT, no such file or directory 'bad/folder/path'

@dmail dmail changed the title fs.symlink bad error output fs.symlink wrong error message Apr 26, 2015
@eezstreet
Copy link

It might be due to the trailing /, but I'm not an expert on this.

@dmail
Copy link
Author

dmail commented Apr 27, 2015

Sorry for the trailing slash, it was a typo, I've edited my message.

@CGavrila
Copy link

I might be getting this wrong, but why would it complain about the target directory? The error message seems to indicate that the source folder does not exist, even though you claim that it does.

Do you get true if you do fs.existsSync('existing/folder/path') ?

@dmail
Copy link
Author

dmail commented Apr 28, 2015

Assuming a exists and b does not,
require('fs').symlinkSync('./a', 'b', 'dir');
succeeds, but
require('fs').symlinkSync('./a', 'unexisting-folder/b', 'dir');
results in
Error: ENOENT, no such file or directory './a'
instead of
Error: ENOENT, no such file or directory 'unexisting-folder'

@CGavrila
Copy link

Right, can confirm that this happens in v0.12, but not in v0.10.

@piscisaureus
Copy link

The error message is incorrect indeed.
I fix in io.js already exists for this - nodejs/node@bc2c85c

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants