* Unfortunately I do not know what may be required to install on Mac
- Make sure most recent version of Node.js is installed and you follow the install prompts to install additional tools which will include visual studio build tools and python etc.
- Link to download: https://nodejs.org/en/download/
- Recommend downloading the LTS version
- For me currently the downloaded installer version is:
node-v18.12.1-x64.msi
- During install make sure you select
Automatically install the necessary tools...
: - After install of Node.js is complete, a PowerShell window will open and ask you to
Press and key to continue...
in order to install the necessary VS Tools to compile native modules. You MUST complete this. - You should see PowerShell start the install and show something like the following:
- It should take a couple minutes to finish at which point you will see a message confirming success and telling you to
Type ENTER to exit:
. You are now ready to continue with the next step.
- Because of some old dependencies, even when you install the latest version of Visual Studio Build Tools via Nodejs (Step 1 above) you still need to manually install the legacy 2017 MSVC build tools by doing the following:
- Download
Build Tools for Visual Studio 2022
installer (or whatever the current version shows today) from https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022 - Launch the downloaded VS Build Tools installer
vs_BuildTools.exe
- Select
Desktop development with C++
checkbox - On the right, expand
Desktop development with C++
, in the Optional section leave everything that is already checked as is and then make sureMSVC v141 - VS 2017 C++...
(towards the bottom) is checked - Now click
Install
and wait for the install to complete.
- Download
- You should now Reboot your computer to ensure all the new tools are available.
- Download the GTK 2 bundle (MUST be GTK2 and NOT GTK3) for Win32 or Win64. Unzip the contents to
C:\GTK
. (see here for more info)- NOTE: I have included the win64 version of GTK2 in this repo in the
resources
folder here:gtk+-bundle_2.22.1-20101229_win64.zip
- After download and extraction, it should look like this:
- NOTE: I have included the win64 version of GTK2 in this repo in the
- Clone this repository using:
https://github.com/GitMurf/help.git
- Now follow the code block below (PowerShell) to install the project and run it for the first time (which will give you the error as described here: #1 which leads to my post here about the goals to fix: #2)
IMPORTANT: You MUST follow steps 1 - 4 above before running the code below.
cd "CLONED-REPO-LOCAL-DIRECTORY\electron-pdf-node-canvas-help"
$env:npm_config_msvs_version = "2017"
npm install
npm run rebuild
After running npm run rebuild
you should see an error similar to the following Canvas.obj : error LNK2019: unresolved external symbol ... ArrayBuffer::GetBackingStore(void) ... Rebuild Failed
(also see screenshot). If you see a different error about GTK / Cairo
OR about error C2429: language feature 'terse static assert' requires compiler flag '/std:c++17'
then you likely did not follow the steps above correctly.)
Now you are as far as I have gotten and have the same error I am trying to troubleshoot and solve by converting node-canvas to use N-API instead of NAN.