gpt4 book ai didi

mysql - 我无法在 node.js 项目上安装 db-mysql

转载 作者:行者123 更新时间:2023-11-29 05:36:01 39 4
gpt4 key购买 nike

在 node.js proeject 上安装 db-mysql 包时。发生了这个错误

npm http GET http://registry.npmjs.org/db-mysql
npm http 304 http://registry.npmjs.org/db-mysql

> db-mysql@0.7.6 install D:\vhosts\node.m.com\node_modules\db-mysql
> node-waf configure build

'node-waf' is not recognized as an internal or external command,
operable program or batch file.

> db-mysql@0.7.6 preuninstall D:\vhosts\node.m.com\node_modules\db-mysql
> rm -rf build/*

'rm' is not recognized as an internal or external command,
operable program or batch file.
npm WARN continuing anyway db-mysql@0.7.6 preuninstall: `rm -rf build/*`
npm WARN continuing anyway `cmd "/c" "rm -rf build/*"` failed with 1

npm ERR! db-mysql@0.7.6 install: `node-waf configure build`
npm ERR! `cmd "/c" "node-waf configure build"` failed with 1
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!
npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "db-mysql"

最佳答案

您正在尝试使用 npm 从 Windows 下的源代码安装二进制模块,目前开箱即用效果不佳。 node-waf 只是一个构建工具,你至少还需要编译器和 Node 头文件。

可能的解决方案:

  • 尝试手动安装(阅读 this article)
  • 使用非二进制、仅 javascript 的模块,例如 node-mysql ( npm install mysql )

关于mysql - 我无法在 node.js 项目上安装 db-mysql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10513339/

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com