aerospike / aerospike-client-nodejs

Node.js client for the Aerospike database
https://www.aerospike.com/
Apache License 2.0
201 stars 78 forks source link

NPM Install Process Very Confusing #4

Closed grannun closed 10 years ago

grannun commented 10 years ago

The installation process for this package is incredibly confusing.

Because I was missing the the libaerospike.a and aerospike.h files that come with the C client SDK, I was unable to install this, and got the following errors.

error: It appears as though one or more files cannot be found.
error: 
error: You can either:
error: 
error:    a. Re-run with 'DOWNLOAD=1'
error:    
error:       $ DOWNLOAD=1 npm install
error: 
error:    b. Set the 'PREFIX' variable to the path containing the files
error:    
error:       $ PREFIX=/usr npm install
error: 
error:    c. Download and install the the Aerospike C Client development package,
error:       then retry the command.
error: 
make: *** [aerospike-client-c/lib/libaerospike.a] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 13.1.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/test_user/aerospike-test/node_modules/aerospike
gyp ERR! node -v v0.10.21
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok 
npm ERR! weird error 1
npm ERR! not ok code 0

I even tried with DOWNLOAD=1, and it still didn't work.

Why are these not included with installation?

cstivers78 commented 10 years ago

Did you install via npm?

npm install aerospike
grannun commented 10 years ago

I did, that's how I got the above output

BTW, I tried this on both my mac and centos 6.4 box, same output

cstivers78 commented 10 years ago

Try the following, then send me the full output:

cd node_modules/aerospike
rm -rf aerospike-client-c
node-gyp clean rebuild
grannun commented 10 years ago

After hitting that error, my node_modules folder is empty

cstivers78 commented 10 years ago

There should be additional lines before those you had sent. Can you send the entire output?

grannun commented 10 years ago
npm http GET https://registry.npmjs.org/aerospike
npm http 200 https://registry.npmjs.org/aerospike
npm http GET https://registry.npmjs.org/aerospike/-/aerospike-1.0.3.tgz
npm http 200 https://registry.npmjs.org/aerospike/-/aerospike-1.0.3.tgz

> aerospike@1.0.3 install /Users/test_user/aerospike-test/node_modules/aerospike
> node-gyp rebuild

  ACTION binding_gyp_aerospike_client_c_target_run_scripts_aerospike_client_c_sh aerospike-client-c/lib/libaerospike.a
info: fetching 'http://www.aerospike.com/latest.php?package=client-c&os=mac'
info: downloading 'http://www.aerospike.com/latest.php?package=client-c&os=mac' to '/Users/test_user/aerospike-test/node_modules/aerospike/aerospike-client-c/package/aerospike-client-c.tgz'
tar: Unrecognized archive format
tar: Error exit delayed from previous errors.
info: extracting '' from 'aerospike-client-c.tgz'
tar: Unrecognized archive format
tar: Error exit delayed from previous errors.
info: extracting files from ''
Error opening xar archive: aerospike-client-c-devel-*.pkg
cat: Payload: No such file or directory
gunzip: (stdin): unexpected end of file
0 blocks
rm: Bom: No such file or directory
rm: PackageInfo: No such file or directory
rm: Payload: No such file or directory

CHECK
   [✗] /Users/test_user/aerospike-test/node_modules/aerospike/aerospike-client-c/package/usr/local/lib/libaerospike.a
   [✗] /Users/test_user/aerospike-test/node_modules/aerospike/aerospike-client-c/package/usr/local/include/aerospike/aerospike.h

error: It appears as though one or more files cannot be found.
error: 
error: You can either:
error: 
error:    a. Re-run with 'DOWNLOAD=1'
error:    
error:       $ DOWNLOAD=1 npm install
error: 
error:    b. Set the 'PREFIX' variable to the path containing the files
error:    
error:       $ PREFIX=/usr npm install
error: 
error:    c. Download and install the the Aerospike C Client development package,
error:       then retry the command.
error: 
make: *** [aerospike-client-c/lib/libaerospike.a] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 13.1.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/test_user/aerospike-test/node_modules/aerospike
gyp ERR! node -v v0.10.21
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok 
npm ERR! weird error 1
npm ERR! not ok code 0
cstivers78 commented 10 years ago

Looks like the URL used is to download the package is invalid for some reason.

I will try to look into why.

cstivers78 commented 10 years ago

I could not find anything wrong the scripts.

I am curious whether the issue is due to the website, where the packages are downloaded from.

Where are you located?

Are you able to view: http://www.aerospike.com

Or download: http://www.aerospike.com/client_downloads/c/3.0.55/aerospike-client-c-3.0.55.mac.tgz

grannun commented 10 years ago

I am located in California, so I don't think that's the issue.

I was only able to solve the problem once I manually downloaded and installed the C client (dev version) and also set the PATH=/usr

I brought up this issue because I felt the purpose of npm install was to work in 1 line, but if nobody else experiences this issue then its not a problem. I figured you wouldn't have run into this because you probably have the C client installed globally

cstivers78 commented 10 years ago

I am glad you resolved the issue. It is intended to be simple. We have not run in to this problem before. I actually do not have the C client installed globally and tend to bring up a new vagrant box for testing.

I had tried it on a few computers, without a problem. So I was concerned with the issue, and was worried it maybe a website issue, due to it appearing you weren't able to download the C client.

apiton commented 10 years ago

Same issue with the PHP driver. Maybe there is a way to add the installation to composer.phar?

wchu-citrusleaf commented 10 years ago

Please open issue on https://github.com/aerospike/aerospike-client-php and additional detail on installation issues. Thanks.