Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error rebuild canvas on Windows #1070

Open
znzn007007 opened this issue Feb 6, 2023 · 3 comments
Open

error rebuild canvas on Windows #1070

znzn007007 opened this issue Feb 6, 2023 · 3 comments

Comments

@znzn007007
Copy link

znzn007007 commented Feb 6, 2023

OS: Windows 11
electron: 19.0.6
canvas: 2.11.0

Canvas.obj : error LNK2019: ????????? "__declspec(dllimport) public: class std::shared_ptr<class v8::BackingStore> __cd
ecl v8::ArrayBuffer::GetBackingStore(void)" (__imp_?GetBackingStore@ArrayBuffer@v8@@QEAA?AV?$shared_ptr@VBackingStore@v
8@@@std@@XZ),?? "void __cdecl parsePNGArgs(class v8::Local<class v8::Value>,struct PngClosure &)" (?parsePNGArgs@@YAXV?
$Local@VValue@v8@@@v8@@AEAUPngClosure@@@Z) ??????? [C:\work\code\desktop\node_modules\canvas\build\canvas.vcx
proj]
CanvasRenderingContext2d.obj : error LNK2001: ????????? "__declspec(dllimport) public: class std::shared_ptr<class v8::
BackingStore> __cdecl v8::ArrayBuffer::GetBackingStore(void)" (__imp_?GetBackingStore@ArrayBuffer@v8@@QEAA?AV?$shared_p
tr@VBackingStore@v8@@@std@@XZ) [C:\work\code\desktop\node_modules\canvas\build\canvas.vcxproj]
ImageData.obj : error LNK2001: ????????? "__declspec(dllimport) public: class std::shared_ptr<class v8::BackingStore> _
_cdecl v8::ArrayBuffer::GetBackingStore(void)" (__imp_?GetBackingStore@ArrayBuffer@v8@@QEAA?AV?$shared_ptr@VBackingStor
e@v8@@@std@@XZ) [C:\work\code\desktop\node_modules\canvas\build\canvas.vcxproj]
C:\work\code\desktop\node_modules\canvas\build\Release\canvas.node : fatal error LNK1120: 1 ?????????? [C:\wo
rk\code\desktop\node_modules\canvas\build\canvas.vcxproj]
✖ Rebuild Failed

An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild 'C:\work\code\desktop\node_modules\canvas'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

Error: `C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1



Error: node-gyp failed to rebuild 'C:\work\code\desktop\node_modules\canvas'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

Error: `C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1


    at NodeGyp.rebuildModule (C:\work\code\desktop\node_modules\electron-rebuild\lib\src\module-type\node-gyp.js:120:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ModuleRebuilder.rebuildNodeGypModule (C:\work\code\desktop\node_modules\electron-rebuild\lib\src\module-rebuilder.js:98:9)
    at async ModuleRebuilder.rebuild (C:\work\code\desktop\node_modules\electron-rebuild\lib\src\module-rebuilder.js:128:14)
    at async Rebuilder.rebuildModuleAt (C:\work\code\desktop\node_modules\electron-rebuild\lib\src\rebuild.js:149:13)
    at async Rebuilder.rebuild (C:\work\code\desktop\node_modules\electron-rebuild\lib\src\rebuild.js:112:17)
    at async C:\work\code\desktop\node_modules\electron-rebuild\lib\src\cli.js:158:9

I have tried electron-rebuild -f -w canvas with Visual Studio 2017 and Visual Studio 2022. But they all can't work

Why and how to resolve it ?

@lqomg
Copy link

lqomg commented Feb 16, 2023

any progress?

@GitMurf
Copy link

GitMurf commented Sep 27, 2023

This can now be closed with recent merged PR for node-canvas moving to the node-addon-api 🎉 Automattic/node-canvas#2235

cc @znzn007007 @lqomg

@ImpChiang
Copy link

so, how to solve this error? @GitMurf @znzn007007

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants