0

操作系统:Mac OS X Lion 10.7.3(64bit)
Xcode:4.3.2
命令行工具:已安装
gcc:4.2
g++:4.2
node:0.6.16
npm:1.1.20
mysql:5.5.21
我尝试安装 npm-modules mysql-libmysqlclient,我在CentOS 6.2上安装成功,但是操作系统有问题,这个说说它的https://github.com/Sannis/node-mysql-libmysqlclient/issues/107#issuecomment-5485498

localhost:nodejs yangzhaojie$ npm -d install mysql-libmysqlclient
npm info it worked if it ends with ok
npm info using npm@1.1.20
npm info using node@v0.6.16
npm http GET https://registry.npmjs.org/mysql-libmysqlclient
npm http 200 https://registry.npmjs.org/mysql-libmysqlclient
npm http GET https://registry.npmjs.org/mysql-libmysqlclient/-/mysql-libmysqlclient-1.3.2.tgz
npm http 200 https://registry.npmjs.org/mysql-libmysqlclient/-/mysql-libmysqlclient-1.3.2.tgz
npm info shasum 8ae08483d5e37fcb5a37e6e459c7eda073ff486b
npm info shasum /var/folders/bc/gxqr_gj55lg1x77dgcym3mmc0000gn/T/npm-1336054761009/1336054761009-0.6183159125503153/tmp.tgz
npm info shasum 2e0901d4c28613050078931d2930b7f98a9353d0
npm info shasum /Users/yangzhaojie/.npm/mysql-libmysqlclient/1.3.2/package.tgz
npm info into /Users/yangzhaojie/tech/nodejs mysql-libmysqlclient@1.3.2
npm info installOne mysql-libmysqlclient@1.3.2
npm info unbuild /Users/yangzhaojie/tech/nodejs/node_modules/mysql-libmysqlclient
npm info preinstall mysql-libmysqlclient@1.3.2
npm info build /Users/yangzhaojie/tech/nodejs/node_modules/mysql-libmysqlclient
npm info linkStuff mysql-libmysqlclient@1.3.2
npm info install mysql-libmysqlclient@1.3.2

> mysql-libmysqlclient@1.3.2 install /Users/yangzhaojie/tech/nodejs/node_modules/mysql-libmysqlclient
> node-gyp rebuild

info it worked if it ends with ok 
spawn python [ '/Users/yangzhaojie/.node-gyp/0.6.16/tools/gyp_addon',
  'binding.gyp',
  '-I/Users/yangzhaojie/tech/nodejs/node_modules/mysql-libmysqlclient/build/config.gypi',
  '-f',
  'make' ]
spawn make [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/mysql_bindings/src/mysql_bindings.o
  CXX(target) Release/obj.target/mysql_bindings/src/mysql_bindings_connection.o
../src/mysql_bindings_connection.cc:1322:22: error: variable length array of non-POD element type 'Local<v8::Value>'
    Local<Value> argv[argc];
                     ^
../src/mysql_bindings_connection.cc:1627:22: error: variable length array of non-POD element type 'Local<v8::Value>'
    Local<Value> argv[argc];
                     ^
../src/mysql_bindings_connection.cc:1691:22: error: variable length array of non-POD element type 'Local<v8::Value>'
    Local<Value> argv[argc];
                     ^
3 errors generated.
make: *** [Release/obj.target/mysql_bindings/src/mysql_bindings_connection.o] Error 1
ERR! Error: `make` failed with exit code: 2
    at ChildProcess.onExit (/Users/yangzhaojie/app/node-0.6.16/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
    at ChildProcess.emit (events.js:70:17)
    at maybeExit (child_process.js:362:16)
    at Process.onexit (child_process.js:398:5)
ERR! not ok
npm info mysql-libmysqlclient@1.3.2 Failed to exec install script
npm info unbuild /Users/yangzhaojie/tech/nodejs/node_modules/mysql-libmysqlclient
npm info preuninstall mysql-libmysqlclient@1.3.2
npm info uninstall mysql-libmysqlclient@1.3.2
npm info postuninstall mysql-libmysqlclient@1.3.2

npm ERR! mysql-libmysqlclient@1.3.2 install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR! 
npm ERR! Failed at the mysql-libmysqlclient@1.3.2 install script.
npm ERR! This is most likely a problem with the mysql-libmysqlclient package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls mysql-libmysqlclient
npm ERR! There is likely additional logging output above.
npm ERR! 
npm ERR! System Darwin 11.3.0
npm ERR! command "node" "/Users/yangzhaojie/app/node-0.6.16/bin/npm" "-d" "install" "mysql-libmysqlclient"
npm ERR! cwd /Users/yangzhaojie/tech/nodejs
npm ERR! node -v v0.6.16
npm ERR! npm -v 1.1.20
npm ERR! code ELIFECYCLE
npm ERR! message mysql-libmysqlclient@1.3.2 install: `node-gyp rebuild`
npm ERR! message `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR! errno {}
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/yangzhaojie/tech/nodejs/npm-debug.log
npm not ok
localhost:nodejs yangzhaojie$
4

2 回答 2

0

你执行了

npm -d install mysql-libmysqlclient

作为超级用户?

尝试

sudo npm -d install mysql-libmysqlclient
于 2012-05-03T15:07:42.050 回答
0
wangmingle@wangmingle01 //
$ npm -d install mysql
npm info it worked if it ends with ok
npm info using npm@1.0.106
npm info using node@v0.4.7
npm info addNamed [ 'mysql', '' ]
npm info fetch http:/registry.npmjs.org/mysql/-/mysql-0.9.6.tgz
npm info shasum 95a3a9f41f94353c6460664b5867997e88b625bc
npm info shasum /tmp/npm-1337774338269/1337774338269-0.257753849029541/tmp.tgz
npm info shasum 7f9fab740989daba691215768ada0d8c36dd477f
npm info shasum /home/wangmingle/.npm/mysql/0.9.6/package.tgz
npm info into / mysql@0.9.6
npm info installOne mysql@0.9.6
npm info unbuild /node_modules/mysql
npm info preinstall mysql@0.9.6
npm info addNamed [ 'hashish', '0.0.4' ]
npm info fetch http:/registry.npmjs.org/hashish/-/hashish-0.0.4.tgz
npm info shasum 6d60bc6ffaf711b6afd60e426d077988014e6554
npm info shasum /tmp/npm-1337774338269/1337774360833-0.05971289472654462/tmp.tgz
npm info shasum 08ecd695975ee21ddb4b6f3e76e288dec99b2617
npm info shasum /home/wangmingle/.npm/hashish/0.0.4/package.tgz
npm info into /node_modules/mysql hashish@0.0.4
npm info installOne hashish@0.0.4
npm info unbuild /node_modules/mysql/node_modules/hashish
npm info preinstall hashish@0.0.4
npm info addNamed [ 'traverse', '>=0.2.4' ]
npm info fetch http:/registry.npmjs.org/traverse/-/traverse-0.6.1.tgz
npm info shasum abba3297d8cd608796189e9bbcda6c7fc6b7a4f9
npm info shasum /tmp/npm-1337774338269/1337774387669-0.5074084696825594/tmp.tgz
npm info shasum 636da24fb8f438ec6b1ca39a6a4f07e130e9aea0
npm info shasum /home/wangmingle/.npm/traverse/0.6.1/package.tgz
npm info into /node_modules/mysql/node_modules/hashish traverse@0.6.1
npm info installOne traverse@0.6.1
npm info unbuild /node_modules/mysql/node_modules/hashish/node_modules/traverse
npm info preinstall traverse@0.6.1
npm info build /node_modules/mysql/node_modules/hashish/node_modules/traverse
npm info linkStuff traverse@0.6.1
npm info install traverse@0.6.1
npm info postinstall traverse@0.6.1
npm info build /node_modules/mysql/node_modules/hashish
npm info linkStuff hashish@0.0.4
npm info install hashish@0.0.4
npm info postinstall hashish@0.0.4
npm info build /node_modules/mysql
npm info linkStuff mysql@0.9.6
npm info install mysql@0.9.6
npm info postinstall mysql@0.9.6
mysql@0.9.6 /node_modules/mysql
└── hashish@0.0.4
npm info ok
于 2012-05-23T12:05:07.970 回答