简体   繁体   中英

“The specified module could not be found” when building a canvas with node-gyp

I would like to install the https://github.com/LearnBoost/node-canvas/ module. I followed the windows installation instruction here

https://github.com/LearnBoost/node-canvas/wiki/Installation---Windows .

After typing: npm install canvas I got the following log:

Creating library F:\Stittch2\node_modules\canvas\build\Release\canvas.lib
and object F:\Stittch2\node_modules\canvas\build\Release\canvas.exp
Generating code
Finished generating code
canvas.vcxproj -> F:\Stittch2\node_modules\canvas\build\Release\\canvas.node
canvas@1.1.3 node_modules\canvas
└── nan@0.4.4

So I thought its compiled successfully, but when I do require('canvas') in node I'm getting the following error:

>node
>require('canvas')
Error: The specified module could not be found.
F:\Stittch2\node_modules\canvas\build\Release\canvas.node
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (F:\Stittch2\node_modules\canvas\lib\bindings.js:2:18)

with 32bit Node/npm.

Seems that I'm not getting this error only with this module.

does this fix solves your issue?

https://github.com/nodejs/node/pull/4215

I think this has been fixed and Node.js 5.3.0 was released with it.

https://github.com/nodejs/node/pull/4281

Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM