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

The path string returned when nan is imported in node 6 is wrong in some cases #600

Open
amatas opened this issue Aug 25, 2016 · 0 comments

Comments

@amatas
Copy link

amatas commented Aug 25, 2016

With the method relative('.', __dirname) in include_dirs.js the path isn't got properly when the parent path is in a shared resource (a link to a network resource in the case of windows):

vboxsrv\vagrant\NODE_MODULES\nan (which doesn't exists)

To reproduce this behavior, run the include_dirs.js with node 6 inside of a shared folder of virtualbox, or in a network resource linked to a drive letter.

amatas added a commit to amatas/nan that referenced this issue Sep 7, 2016
The latest implementation of the path.relative function of node v6 seems
to be broken when either of the "from" or "to" paths are in a network
resource of windows, removing the leading backslashes "\\" and returning
a wrong path [0].

The new approach employs the path.resolve function that returns the
absolute path to the nan headers and seems to work fine in the case of
node v6 running in a windows box.

Tests:

* Windows 10 with node 4.3.0:
  c:\>node -e "console.log(require('path').relative('.','\\\\VBOXSRV\\vagrant'))"
  returns: \\VBOXSRV\vagrant\

* Windows 10 with node 6.5.0:
  c:\>node -e "console.log(require('path').relative('.','\\\\VBOXSRV\\vagrant'))"
  returns: VBOXSRV\vagrant\

[0] nodejs#600
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