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

Installation fails if current path includes spaces #39

Open
tiagosiebler opened this issue Jun 14, 2018 · 5 comments
Open

Installation fails if current path includes spaces #39

tiagosiebler opened this issue Jun 14, 2018 · 5 comments

Comments

@tiagosiebler
Copy link

If you're in a folder where one of our parent folders contains a space in the name, tulind will fail to install. It's really easy to reproduce in a unix environment:

  • mkdir "test dir";
  • cd "test dir";
  • npm init -y;
  • npm install tulind;

Example error:

$ npm install tulind;

> [email protected] install /Users/myuser/Downloads/test dir/node_modules/tulind
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://tulipnode.s3.amazonaws.com/tulind/v0.8.10/Release/tulind-v0.8.10-node-v57-darwin-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v57 ABI, unknown) (falling back to source compile with node-gyp) 
  CXX(target) Release/obj.target/tulind/tulind.o
../tulind.cpp:72:22: warning: comparison of integers of different signs: 'const int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
    if (ind->options != options->Length()) {
        ~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~
../tulind.cpp:236:10: warning: 'MakeCallback' is deprecated [-Wdeprecated-declarations]
    Nan::MakeCallback(Nan::GetCurrentContext()->Global(), callbackHandle, 2, cb_argv);
         ^
../../nan/nan.h:929:3: note: 'MakeCallback' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
  ^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
../tulind.cpp:127:21: warning: comparison of integers of different signs: 'const int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
    if (ind->inputs != inputs->Length()) {
        ~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~
../tulind.cpp:134:22: warning: comparison of integers of different signs: 'const int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
    if (ind->options != options->Length()) {
        ~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~
4 warnings generated.
  CC(target) Release/obj.target/tulind/external/tiamalgamation.o
  SOLINK_MODULE(target) /Users/myuser/Downloads/test dir/node_modules/tulind/lib/binding/Release/node-v57-darwin-x64/tulind.node
clang: error: no such file or directory: 'dir/node_modules/tulind/lib/binding/Release/node-v57-darwin-x64/tulind.node'
make: *** [/Users/myuser/Downloads/test dir/node_modules/tulind/lib/binding/Release/node-v57-darwin-x64/tulind.node] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/myuser/.npm-packages/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Darwin 17.6.0
gyp ERR! command "/usr/local/bin/node" "/Users/myuser/.npm-packages/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/myuser/Downloads/test dir/node_modules/tulind/lib/binding/Release/node-v57-darwin-x64/tulind.node" "--module_name=tulind" "--module_path=/Users/myuser/Downloads/test dir/node_modules/tulind/lib/binding/Release/node-v57-darwin-x64" "--napi_version=1" "--node_abi_napi=napi"
gyp ERR! cwd /Users/myuser/Downloads/test dir/node_modules/tulind
gyp ERR! node -v v8.9.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /Users/myuser/.npm-packages/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/myuser/Downloads/test dir/node_modules/tulind/lib/binding/Release/node-v57-darwin-x64/tulind.node --module_name=tulind --module_path=/Users/myuser/Downloads/test dir/node_modules/tulind/lib/binding/Release/node-v57-darwin-x64 --napi_version=1 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/myuser/Downloads/test dir/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Darwin 17.6.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/myuser/Downloads/test dir/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/myuser/Downloads/test dir/node_modules/tulind
node-pre-gyp ERR! node -v v8.9.1
node-pre-gyp ERR! node-pre-gyp -v v0.9.1
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /Users/myuser/.npm-packages/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/myuser/Downloads/test dir/node_modules/tulind/lib/binding/Release/node-v57-darwin-x64/tulind.node --module_name=tulind --module_path=/Users/myuser/Downloads/test dir/node_modules/tulind/lib/binding/Release/node-v57-darwin-x64 --napi_version=1 --node_abi_napi=napi' (1)
npm WARN test dir No description
npm WARN test dir No repository field.
npm WARN test dir No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/myuser/.npm/_logs/2018-06-14T16_33_25_950Z-debug.log
@tiagosiebler
Copy link
Author

Anyone had a chance to look into this? It's a bit awkward of an issue for some of my users.

@codeplea
Copy link
Member

codeplea commented Aug 7, 2018

This is an issue with node-pre-gyp. I reproduced the problem using their example addon, and so I opened an issue there: mapbox/node-pre-gyp#409

When it's fixed there, I will update my dependency, if needed, and republish.

@tiagosiebler
Copy link
Author

Thank you @codeplea!

@codeplea
Copy link
Member

Well, the node-pre-gyp people say it's an issue with node-gyp, and the node-gyp people say it's an issue with gyp. And it's been bothering people for several years (since 2012 at least).

I guess it could be fixed at any of those levels. Maybe we could fix it here with a simple regex that finds the unescaped line and adds quotes. I don't know.

@tiagosiebler
Copy link
Author

Would it be possible to fix this here, ensuring the parameter causing this is wrapped in quotes? That would eliminate the issue for anyone seeing it with this module.

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

No branches or pull requests

2 participants