使用npm的db-mysql安装错误

时间:2013-12-18 12:51:36

标签: node.js

我正在尝试使用

为node.js安装db-mysql模块

sudo npm install db-mysql

但是我收到以下错误:

npm WARN package.json hbase@0.0.5 No repository field.
npm WARN package.json log4js@0.2.2 No repository field.
npm WARN package.json mime@1.1.0 No repository field.
npm WARN package.json restler@2.0.1 No repository field.
npm WARN package.json db-mysql@0.7.6 'repositories' (plural) Not supported.
npm WARN package.json Please pick one as the 'repository' field
npm http GET https://registry.npmjs.org/db-mysql
npm http 304 https://registry.npmjs.org/db-mysql

> db-mysql@0.7.6 install /home/lifemap/lifemap-upload-master/node_modules/db-mysql
> node-waf configure build

sh: 1: node-waf: not found

> db-mysql@0.7.6 preuninstall /home/lifemap/lifemap-upload-master/node_modules/db-mysql
> rm -rf build/*

npm ERR! db-mysql@0.7.6 install: `node-waf configure build`
npm ERR! Exit status 127
npm ERR! 
npm ERR! Failed at the db-mysql@0.7.6 install script.
npm ERR! This is most likely a problem with the db-mysql package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-waf configure build
npm ERR! You can get their info via:
npm ERR!     npm owner ls db-mysql
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.2.0-54-virtual
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "db-mysql"
npm ERR! cwd /home/lifemap/lifemap-upload-master
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.14
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/lifemap/lifemap-upload-master/npm-debug.log
npm ERR! not ok code 0`

我是否需要为db-mysql使用或安装任何其他命令或版本?

2 个答案:

答案 0 :(得分:2)

以下是问题的根本原因

  

sh:1:node-waf:not found

node-waf 已被Node 0.8中的 node-gyp 取代,因此您将无法构建此模块,除非您将分叉模块和将它更改为使用node-gyp。基本上,似乎不再支持db-mysql。

作为替代,您可以使用mysql模块,该模块得到了积极支持。

答案 1 :(得分:-1)

您可以尝试使用this方法之一而无需sudo。希望它能奏效!