我已经在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/