Windows 上是否有 Node.js 的 node-waf?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12784161/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 15:56:09  来源:igfitidea点击:

Is there any node-waf for Node.js on windows?

windowsnode.jsnpmwaf

提问by Diego

I am trying to install the 'png' module from Node.js using the following command:

我正在尝试使用以下命令从 Node.js 安装“png”模块:

npm install png

npm 安装 png

however I am getting the following error:

但是我收到以下错误:

node-waf configure build

node-waf 配置构建

'node-waf' is not recognized as an internal or external command

'node-waf' 不被识别为内部或外部命令

My question is: Is there node-waf for windows?

我的问题是:windows 有 node-waf 吗?

回答by josh3736

As of Node 0.8, the waf build system has been removedand replaced with the cross-platform node-gyp.

从 Node 0.8 开始,waf 构建系统已被删除并替换为跨平台的node-gyp

To get gyp running on Windows, you need Python 2.7and MS Visual C++(and for x64 builds, the Win 7 x64 SDK).

要在 Windows 上运行 gyp,您需要Python 2.7MS Visual C++(对于 x64 版本,需要Win 7 x64 SDK)。

Of course, having gyp doesn't help you install the particular package you want (since it uses waf). Normally, you'd have to get the project's maintainer to upgrade to the new build system, or fork it and fix it yourself (it's not that hard).

当然,使用 gyp 并不能帮助您安装所需的特定软件包(因为它使用 waf)。通常,您必须让项目的维护者升级到新的构建系统,或者 fork 并自己修复它(这并不)。

However, it looks like the author of node-png in fact has added gyp bindings in the GitHub repo, but hasn't pushed those changes to npm (perhaps they don't work yet). You could try cloning the repo and seeing if you can get it to build.

然而,看起来 node-png 的作者实际上已经在GitHub repo 中添加了 gyp 绑定,但没有将这些更改推送到 npm(也许它们还没有工作)。您可以尝试克隆 repo 并查看是否可以构建它。