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

install in directory where parent directory has spaces #18

Closed
julianbrowne opened this issue Apr 23, 2014 · 2 comments · Fixed by #20
Closed

install in directory where parent directory has spaces #18

julianbrowne opened this issue Apr 23, 2014 · 2 comments · Fixed by #20

Comments

@julianbrowne
Copy link

There seems to be a known issue with node-gyp and installing in directories where the parents directories contain spaces: nodejs/node-gyp#65.
This certainly seems to be my case (works without spaces, fails with).
The problem is in binding.gyp at:

'include_dirs': ["<!(node -p -e \"require('path').dirname(require.resolve('nan'))\")"]

A simple string replace in the node script looks to fix it:

{
  "targets": [
    {
      "target_name": "hashvalue",
      'include_dirs': ["<!(node -p -e \"require('path').dirname(require.resolve('nan')).replace(/ /g, '\\\\\ ')\")"],
      "sources": [ "src/hashvalue.cc" ]
    }
  ]
}
@3rd-Eden
Copy link
Owner

Is there any way we could write test against this?

@julianbrowne
Copy link
Author

Or (just a thought) - that line is only there to find nan.h, which is always installed by npm relative to binding.gyp at node_modules/nan. So this works without any executable code at all:

{
  "targets": [
    {
      "target_name": "hashvalue",
      "include_dirs": ["node_modules/nan"],
      "sources": [ "src/hashvalue.cc" ]
    }
  ]
}

Better?

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

Successfully merging a pull request may close this issue.

2 participants