Open
Description
Issue or Feature
- If this is an issue with installation, I have read the troubleshooting guide.
PS C:\Users\lin\.node-red> npm install canvas
npm error code 1
npm error path C:\Users\lin\.node-red\node_modules\canvas
npm error command failed
npm error command C:\Windows\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build --update-binary
npm error node:internal/modules/cjs/loader:1189
npm error throw err;
npm error ^
npm error
npm error Error: Cannot find module 'C:\Users\lin\.node-red\node_modules\node-pre-gyp\bin\node-pre-gyp'
npm error at Module._resolveFilename (node:internal/modules/cjs/loader:1186:15)
npm error at Module._load (node:internal/modules/cjs/loader:1012:27)
npm error at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:158:12)
npm error at node:internal/main/run_main_module:30:49 {
npm error code: 'MODULE_NOT_FOUND',
npm error requireStack: []
npm error }
npm error
npm error Node.js v22.2.0
npm error A complete log of this run can be found in: C:\Users\lin\AppData\Local\npm-cache\_logs\2024-07-17T08_52_41_561Z-debug-0.log
PS C:\Users\lin\.node-red> npm install canvas@next
npm error code 1
npm error path C:\Users\lin\.node-red\node_modules\canvas
npm error command failed
npm error command C:\Windows\system32\cmd.exe /d /s /c prebuild-install -r napi || node-gyp rebuild
npm error Warning: Missing input files:
npm error C:\GTK\bin\libpangoft2-1.0-0.dll
npm error C:\GTK\bin\libfontconfig-1.dll
npm error C:\GTK\bin\libglib-2.0-0.dll
npm error C:\GTK\bin\libfreetype-6.dll
npm error C:\GTK\bin\libexpat-1.dll
npm error C:\GTK\bin\libpangocairo-1.0-0.dll
npm error C:\GTK\bin\libgobject-2.0-0.dll
npm error C:\GTK\bin\libcairo-2.dll
npm error C:\GTK\bin\libpng14-14.dll
npm error C:\GTK\bin\libintl-8.dll
npm error C:\GTK\bin\libgmodule-2.0-0.dll
npm error C:\GTK\bin\libgthread-2.0-0.dll
npm error C:\GTK\bin\libpango-1.0-0.dll
npm error C:\GTK\bin\libpangowin32-1.0-0.dll
npm error �b���ѨM��פ��@���ظm�@�ӱM�סC�Y�n�ҥΥ���ظm�A�зs�W "-m" �ѼơC
npm error
npm error Backend.cc
npm error C:\Users\lin\.node-red\node_modules\node-addon-api\napi-inl.h(1042,5): warning C4127: ����B�⦡�O�`�� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\Users\lin\.node-red\node_modules\node-addon-api\napi-inl.h(1042,5): message : �ЦҼ{��� 'if constexpr' ���z�� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\Users\lin\.node-red\node_modules\node-addon-api\napi-inl.h(1057,5): warning C4127: ����B�⦡�O�`�� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\Users\lin\.node-red\node_modules\node-addon-api\napi-inl.h(1057,5): message : �ЦҼ{��� 'if constexpr' ���z�� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\Users\lin\.node-red\node_modules\canvas\src\backend\Backend.cc(6,7): warning C4458: 'width' ���ŧi�|�������O���� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\Users\lin\.node-red\node_modules\canvas\src\backend\Backend.h(18,9): message : �аѾ\ 'Backend::width' ���ŧi [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\Users\lin\.node-red\node_modules\canvas\src\backend\Backend.cc(7,7): warning C4458: 'height' ���ŧi�|�������O���� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\Users\lin\.node-red\node_modules\canvas\src\backend\Backend.h(19,9): message : �аѾ\ 'Backend::height' ���ŧi [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error ImageBackend.cc
npm error C:\Users\lin\.node-red\node_modules\node-addon-api\napi-inl.h(1042,5): warning C4127: ����B�⦡�O�`�� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\Users\lin\.node-red\node_modules\node-addon-api\napi-inl.h(1042,5): message : �ЦҼ{��� 'if constexpr' ���z�� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\Users\lin\.node-red\node_modules\node-addon-api\napi-inl.h(1057,5): warning C4127: ����B�⦡�O�`�� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\Users\lin\.node-red\node_modules\node-addon-api\napi-inl.h(1057,5): message : �ЦҼ{��� 'if constexpr' ���z�� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error PdfBackend.cc
npm error C:\Users\lin\.node-red\node_modules\node-addon-api\napi-inl.h(1042,5): warning C4127: ����B�⦡�O�`�� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\Users\lin\.node-red\node_modules\node-addon-api\napi-inl.h(1042,5): message : �ЦҼ{��� 'if constexpr' ���z�� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\Users\lin\.node-red\node_modules\node-addon-api\napi-inl.h(1057,5): warning C4127: ����B�⦡�O�`�� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\Users\lin\.node-red\node_modules\node-addon-api\napi-inl.h(1057,5): message : �ЦҼ{��� 'if constexpr' ���z�� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\GTK\include\glib-2.0\glib\gmacros.h(1,1): warning C4819: �ɮקt���L�k�b�ثe�r�X�� (950) �����ܪ��r���C�ХH Unicode �榡�x�s�ɮץH�����ƿ� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\GTK\include\glib-2.0\glib\gmacros.h(839,1): warning C4819: �ɮקt���L�k�b�ثe�r�X�� (950) �����ܪ��r���C�ХH Unicode �榡�x�s�ɮץH�����ƿ� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\GTK\include\glib-2.0\glib\gatomic.h(1,1): warning C4819: �ɮקt���L�k�b�ثe�r�X�� (950) �����ܪ��r���C�ХH Unicode �榡�x�s�ɮץH�����ƿ� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\GTK\include\glib-2.0\glib\gfileutils.h(1,1): warning C4819: �ɮקt���L�k�b�ثe�r�X�� (950) �����ܪ��r���C�ХH Unicode �榡�x�s�ɮץH�����ƿ� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\GTK\include\glib-2.0\glib\gmain.h(1,1): warning C4819: �ɮקt���L�k�b�ثe�r�X�� (950) �����ܪ��r���C�ХH Unicode �榡�x�s�ɮץH�����ƿ� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\GTK\include\glib-2.0\glib\gtestutils.h(1,1): warning C4819: �ɮקt���L�k�b�ثe�r�X�� (950) �����ܪ��r���C�ХH Unicode �榡�x�s�ɮץH�����ƿ� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\GTK\include\glib-2.0\glib\guri.h(1,1): warning C4819: �ɮקt���L�k�b�ثe�r�X�� (950) �����ܪ��r���C�ХH Unicode �榡�x�s�ɮץH�����ƿ� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\GTK\include\glib-2.0\glib\glib-autocleanups.h(1,1): warning C4819: �ɮקt���L�k�b�ثe�r�X�� (950) �����ܪ��r���C�ХH Unicode �榡�x�s�ɮץH�����ƿ� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\GTK\include\glib-2.0\gobject\gobject.h(1,1): warning C4819: �ɮקt���L�k�b�ثe�r�X�� (950) �����ܪ��r���C�ХH Unicode �榡�x�s�ɮץH�����ƿ� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\GTK\include\glib-2.0\gobject\gtype.h(1,1): warning C4819: �ɮקt���L�k�b�ثe�r�X�� (950) �����ܪ��r���C�ХH Unicode �榡�x�s�ɮץH�����ƿ� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\GTK\include\glib-2.0\gobject\gtype.h(877,1): warning C4819: �ɮקt���L�k�b�ثe�r�X�� (950) �����ܪ��r���C�ХH Unicode �榡�x�s�ɮץH�����ƿ� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\GTK\include\glib-2.0\gobject\gsignal.h(1,1): warning C4819: �ɮקt���L�k�b�ثe�r�X�� (950) �����ܪ��r���C�ХH Unicode �榡�x�s�ɮץH�����ƿ� [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error C:\GTK\include\pango-1.0\pango\pango-coverage.h(28,10): fatal error C1083: �L�k�}�ҥ]�t�ɮ�: 'hb.h': No such file or directory [C:\Users\lin\.node-red\node_modules\canvas\build\canvas.vcxproj]
npm error prebuild-install warn install No prebuilt binaries found (target=7 runtime=napi arch=x64 libc= platform=win32)
npm error gyp info it worked if it ends with ok
npm error gyp info using [email protected]
npm error gyp info using [email protected] | win32 | x64
npm error gyp info find Python using Python version 3.12.0 found at "C:\Python312\python.exe"
npm error gyp info find VS using VS2022 (17.6.33712.159) found at:
npm error gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
npm error gyp info find VS run with --verbose for detailed information
npm error gyp info spawn C:\Python312\python.exe
npm error gyp info spawn args [
npm error gyp info spawn args 'C:\\Users\\lin\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm error gyp info spawn args 'binding.gyp',
npm error gyp info spawn args '-f',
npm error gyp info spawn args 'msvs',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'C:\\Users\\lin\\.node-red\\node_modules\\canvas\\build\\config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'C:\\Users\\lin\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'C:\\Users\\lin\\AppData\\Local\\node-gyp\\Cache\\22.2.0\\include\\node\\common.gypi',
npm error gyp info spawn args '-Dlibrary=shared_library',
npm error gyp info spawn args '-Dvisibility=default',
npm error gyp info spawn args '-Dnode_root_dir=C:\\Users\\lin\\AppData\\Local\\node-gyp\\Cache\\22.2.0',
npm error gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\lin\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\lin\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\22.2.0\\\\<(target_arch)\\\\node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=C:\\Users\\lin\\.node-red\\node_modules\\canvas',
npm error gyp info spawn args '-Dnode_engine=v8',
npm error gyp info spawn args '--depth=.',
npm error gyp info spawn args '--no-parallel',
npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'C:\\Users\\lin\\.node-red\\node_modules\\canvas\\build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error gyp info spawn C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
npm error gyp info spawn args [
npm error gyp info spawn args 'build\\binding.sln',
npm error gyp info spawn args '/clp:Verbosity=minimal',
npm error gyp info spawn args '/nologo',
npm error gyp info spawn args '/p:Configuration=Release;Platform=x64'
npm error gyp info spawn args ]
npm error gyp ERR! build error
npm error gyp ERR! stack Error: `C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
npm error gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\lin\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:209:23)
npm error gyp ERR! stack at ChildProcess.emit (node:events:520:28)
npm error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm error gyp ERR! System Windows_NT 10.0.22631
npm error gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\lin\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm error gyp ERR! cwd C:\Users\lin\.node-red\node_modules\canvas
npm error gyp ERR! node -v v22.2.0
npm error gyp ERR! node-gyp -v v10.1.0
npm error gyp ERR! not ok
npm error A complete log of this run can be found in: C:\Users\lin\AppData\Local\npm-cache\_logs\2024-07-17T08_53_36_724Z-debug-0.log
Steps to Reproduce
var Canvas = require('canvas');
var canvas = Canvas.createCanvas(200, 200);
var ctx = canvas.getContext('2d');
// etc.
Your Environment
- Version of node-canvas (output of
npm list canvas
oryarn list canvas
): - Environment (e.g. node 20.9.0 on macOS 14.1.1):
windows
i have installed node-pre-gyp
set C:\GTK
and add path of environment
PS C:\Users\lin.node-red> npm install -g node-pre-gyp
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
added 67 packages in 4s
3 packages are looking for funding
run npm fund
for details
PS C:\Users\lin.node-red> node -v
v22.2.0