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

node-gyp fails when on drive/folder with space in name #439

Closed
davidrinnan opened this issue May 6, 2014 · 3 comments
Closed

node-gyp fails when on drive/folder with space in name #439

davidrinnan opened this issue May 6, 2014 · 3 comments

Comments

@davidrinnan
Copy link

this was originally a bug that I posted at node-canvas
Automattic/node-canvas#407

I have two harddrives which means that osx gave them the names HD 1 and HD 2.

When I npm install canvas I get:

clang: error: no such file or directory: 'HD'
clang: error: no such file or directory: '2/davidrinnan/.node-gyp/0.10.26/src'
clang: error: no such file or directory: 'HD'
clang: error: no such file or directory: '2/davidrinnan/.node-gyp/0.10.26/deps/uv/include'
clang: error: no such file or directory: 'HD'
clang: error: no such file or directory: '2/davidrinnan/.node-gyp/0.10.26/deps/v8/include'

The drive used is called 'Macintosh HD 2' and we can see how it breaks down the harddrive name into individual paths rather than putting the name between ' '

The strange thing is that I have many modules installed but node canvas is the first that has caused issues. It apparently tries to do a node-gyp rebuild. I guess very few others do.

So I made sure that node-gyp was updated to the latest version. But same issue anyways...

I then found out that npm uses its own node-gyp, regardless of the version that I have installed but I found the command to update npms internal node-gyp as well. Still same issue.

And as one can see in the error message I am running 0.10.26 of node. First I was running 10.20 but I had the same error message there as well...

@a0viedo
Copy link
Member

a0viedo commented Mar 27, 2018

hey @davidrinnan, it's been some time now. is this still an issue?

@working-name
Copy link

Still an issue on macOS when .node-gyp is in a location with spaces in the path. Moving the .node-gyp to another location without spaces and exporting the new path will help you get over this kind of trouble.

#copy your current .node-gyp to another path
cp -R ~/.node-gyp /Path/Without/Spaces
#export the new ENV var, or add it to your .bashrc or whatever
export npm_config_devdir=/Path/Without/Spaces/.node-gyp
#retry the install, it should now compile ok.
npm i <trouble module>

@bnoordhuis
Copy link
Member

Right, this is still an issue but it's unlikely to get fixed because it's not just node-gyp that's sensitive to blanks in paths.

I'll go ahead and close this out as a wontfix. The workaround is to use a path without blanks, like @working-name describes.

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

4 participants