windows - nodejs - 在 Windows 中 npm 安装 Canvas 错误

标签 windows node.js npm

我已经在Windows上安装了nodejs并尝试使用以下命令添加canvas模块...

npm install canvas

我收到以下错误消息...

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

有没有办法在 Windows 上安装 node-waf 或者安装模块的替代方法?

最佳答案

我读到您应该尝试使用 Gyp 而不是 node-waf。显然它的跨平台性也更好。

Up to version 0.4 the node.js team offered node-waf (a waf 1.5.3 wrapper script) to configure and build modules for node.js. This was fine since in windows there was no native support and you had to use Cygwin to make your builds. From version 0.5 and on, there node supports native windows builds which brings visual studio in to play. The problem is that waf started supporting visual studio’s msbuild from version 1.6 and on and this was a major setback. In the meanwhile the node.js team decided to move on to gyp and abandoned the node-waf script. If you are tempted to create a node-waf wrapping waf 1.6, try to resist. A lot of things have changed in waf 1.6 and when I finished modifying the script, I still couldn’t generate proper windows builds (I would have to hardwire the linking arguments in order to link the object to node.lib just for windows). On the other hand, gyp supports custom arguments depending on the building platform which makes the gyp files easier to maintain.

http://botsikas.blogspot.com/2011/12/nodejs-modules-cross-platform.html

关于windows - nodejs - 在 Windows 中 npm 安装 Canvas 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9470767/

相关文章:

windows - 静态链接 openssl 库

c++ - 如何探索.A库文件中的函数

mysql - 使用node-mysql查询多行

javascript - TypeError : firebase. auth(...).onAuthStateChanged 不是函数

windows - git 如何清理克隆的存储库并重新克隆

c++ - 使用 C++/CX for Desktop Windows 的 XAML 应用程序

angularjs - 为什么即使添加 CORS 后,我仍然在 http 请求中收到状态代码 403?

node.js - Loopback JS 全局错误日志记录

javascript - 以编程方式使用 "npm install"的问题

ionic-framework - npm WARN 已弃用 minimatch@2.0.10 : Please update to minimatch 3. 0.2